![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Name Services (Package V_Names) This chapter contains an overview describing this package. This overview section is followed by a detailed description of each subprogram in this package.
The following topics are covered in this section:
Package OverviewDescription
V_Names provides name services. These services allow objects to be shared between programs or, in conjunction with V_Xtasking.Inter_Program_Call, allow a procedure to be called from another program. V_Names has been layered on the Ada Kernel name services.
Resolve_Object and Resolve_Procedure first attempt to find an already bound name that exactly matches the name parameter. For a match, they return immediately. Otherwise, according to a wait_time parameter, they wait indefinitely until the name is bound, return immediately and raise the Name_Resolve_Failed exception, or raise the Name_Resolve_Timed_Out exception if the name is not bound within Wait_Time.
Warning: For native, names are only known within a single program. Name binding and resolution services are more applicable to the cross-target environment.
Package Procedures And Functions
Table 17 lists the procedures and functions in package V_Names with a brief description of each subprogram.
Constants
Table 18 lists the exceptions in package V_Names.
Exceptions
Table 19 lists the exceptions in package V_Names.
Package Specification
with System; package V_NAMES is
pragma SUPPRESS(ALL_Checks);
Wait_Forever : constant duration := -1.0; DO_NOT_Wait : constant duration := 0.0;
NO_Memory_FOR_NAME : exception;
NAME_SERVICE_NOT_SUPPORTED : exception;
BAD_ARGUMENT_FOR_NAME_SERVICE : exception;
NAME_ALREADY_BOUND : exception;
NAME_RESOLVE_TIMED_OUT : exception;
NAME_RESOLVE_FAILED : exception;
procedure Bind_Object (name : in string; object_address : in system.address);
procedure Bind_Procedure (name : in string; procedure_address : in system.address);
procedure Bind_Procedure (name : in string; procedure_program : in system.program_id; procedure_address : in system.address);
procedure Resolve_Object (name : in string; object_address : out system.address; wait_time : in duration := Wait_Forever);
function Resolve_Object (name : in string; wait_time : in duration := Wait_Forever) return system.address;
procedure Resolve_Procedure (name : in string; procedure_program : out system.program_id; procedure_address : out system.address; wait_time : in duration := Wait_Forever);
end V_NAMES;
Procedures and Functions in Package V_Namesprocedure Bind_Object
Syntax
procedure Bind_Object (name : in string; object_address : in system.address);Arguments
- name
Object name. The name can be any sequence of characters. An exact match is done for all name searches. (My_Object is different from my_object.)
- object_address
Description
Bind_Object binds a name to the address of an object.
Exceptions
- No_Memory_For_Name
Raised if the name could not be bound because of insufficient memory.
- Name_Service_Not_Supported
Raised if name services are not supported by the underlying RTS.
- Bad_Argument_For_Name_Service
Raised if a null name is passed.
- Name_Already_Bound
Raised if the name is already bound to another object or procedure.
Warning: Names are only known within a single program. Name binding and resolution services are more applicable to the cross-target environment.
procedure Bind_Procedure
Syntax
procedure Bind_Procedure (name : in string; procedure_address : in system.address);
procedure Bind_Procedure (name : in string; procedure_program : in system.program_id; procedure_address : in system.address);Arguments
- name
procedure name. The name can be any sequence of characters. An exact match is done for all name searches. (My_Procedure is different from my_procedure.)
- procedure_program
procedure's Program ID. Set procedure_program to No_Program_ID if the current program and stack limit switch logic are to be omitted for a V_Xtasking.Inter_Program_Call().
- procedure_address
Description
Bind_Procedure binds a name to the Program ID and address of a procedure. When the procedure_program parameter is omitted, it is set to the current program.
Exceptions
- No_Memory_For_Name
Raised if the name could not be bound because of insufficient memory.
- Name_Service_Not_Supported
Raised if name services are not supported by the underlying RTS.
- Bad_Argument_For_Name_Service
Raised if a null name is passed.
- Name_Already_Bound
Raised if the name is already bound to another object or procedure.
Warning: For native, names are only known within a single program. Name binding and resolution services are more applicable to the cross-target environment.
procedure/function Resolve_Object
Syntax
procedure Resolve_Object (name : in string; object_address : out system.address; wait_time : in duration := Wait_Forever); function Resolve_Object (name : in string; wait_time : in duration := Wait_Forever) return system.address;Arguments
- name
- object_address
- wait_time
Amount of time the user is willing to wait for the name to be bound. Two allowable predefined values are
Description
Resolve_Object resolves the name of an object into its address. Two versions are supplied: a procedure that returns the address as an out parameter or a function returning the object address.
Resolve_Object first attempts to find an already bound name that exactly matches the name parameter. For a match, it returns immediately. Otherwise, it returns according to the wait_time parameter.
Exceptions
- Name_Service_Not_Supported
Raised if name services are not supported by the underlying RTS.
- Bad_Argument_For_Name_Service
Raised if a null name is passed.
- Name_Resolve_Timed_Out
Raised if a timed wait is attempted and the name does not become bound in the given time interval.
- Name_Resolve_Failed
Raised if a nonwaited attempt is made and the name is not already bound.
Warning: For native, names are only known within a single program. Name binding and resolution services are more applicable to the cross-target environment.
procedure Resolve_Procedure
Syntax
procedure Resolve_Procedure (name : in string; procedure_program : out system.program_id; procedure_address : out system.address; wait_time : in duration := Wait_Forever);Arguments
- name
- procedure_address
- procedure_program
- wait_time
Amount of time the user is willing to wait for the name to be bound. Two allowable predefined values are:
Description
Resolve_Procedure resolves the name of a procedure into its program_id and address. The program_id and address can be used to call the procedure with the V_Xtasking.Inter_Program_Call service.
Resolve_Procedure first attempts to find an already bound name that exactly matches the name parameter. For a match, it returns immediately. Otherwise, it returns according to the wait_time parameter.
Exceptions
- Name_Service_Not_Supported
Raised if name services are not supported by the underlying RTS.
- Bad_Argument_For_Name_Service
Raised if a null name is passed.
- Name_Resolve_Timed_Out
Raised if a timed wait is attempted and the name does not become bound in the given time interval.
- Name_Resolve_Failed
Raised if a non-waited attempt is made and the name is not already bound.
Warning: For native, names are only known within a single program. Name binding and resolution services are more applicable to the cross-target environment.
Rational Software Corporation http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2003, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |