8.1 Legion Library interface

The following section lists the functions which interface with the C++ Legion Library.

int
Legion_init();

Initializes the legion library (for a Legion object started by a Legion host, not for a command line object). This function, or one of the other init functions must be called in all Legion programs before any other Legion calls are made. This does not preclude calls to the CLegionLib which do not directly interact with Legion.

Parameters: None

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
Legion_init_with_class(char *ClassID, int ClassIdLen);

Initializes the Legion library (for a Legion object started as an instance of a certain Legion class, but perhaps started on the user's command line). This function, or one of the other init functions must be called in all Legion programs before any other Legion calls are made. This does not preclude calls to the CLegionLib which do not directly interact with Legion.

Parameters:
char* ClassID = The representation of the class which
instantiated the given object. These are not
strings so much as byte arrays.

int ClassIdLen = Length of the "byte" array given for ClassID.

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
Legion_init_command_line_class();

Initializes the legion library (for a Legion object started on the command line as a main Legion program). For most client tools, this version of create will be the one used. This function, or one of the other init functions must be called in all Legion programs before any other Legion calls are made. This does not preclude calls to the CLegionLib which do not directly interact with Legion.

Parameters: None

Return Values:
1 on Success
0 on Failure

User Responsibility: None

char*
Legion_GetLegionClassLOID();

Obtains the string representation of the LOID of the LegionClass object.

Parameters: None

Return Values:
LOID of the LegionClass object.

Error Return:
NULL

User Responsibility:
User is responsible for "free"ing memory allocated for the LOID.

CLegionBinding
Legion_GetLegionClassBinding();

Obtains the current binding for the LegionClass object.

Parameters: None

Return Values:
LegionBinding for LegionClass object

Error Return:
0

User Responsibility:
User is responsible for calling DestroyLegionBinding on the
returned binding when done with it.

int
Legion_AcceptMethods();

Enables the receipt of messages in the Legion library. This function must be called prior to any other function which might make outcalls to other objects, or receive methods or return values from any other objects.

Parameters: None

Return Values:
1 on Success
0 on Failure

User Responsibility: None

int
Legion_DeleteSelf();

Indicates to the object's (program's) class that the program is finished and ready to go away. After this function is called, the user's code may run for some undetermined amount of time, but will eventually be killed if it doesn't exit.

Parameters: None

Return Values:
1 on Success
0 on Failure

User Responsibility: None

void

Legion_Sleep(int secs);

Causes the user's code to pause for approximately. the number of seconds requested, while still handling external Legion events (such as method receives, exception receives, etc.).

Parameters:
secs = Number of seconds to sleep for.

Return Values: None

User Responsibility: None

char*
ClassOf(LegionIdType IdType, char *ObjName);

Returns the LOID of the indicated object's class.

Parameters:
IdType = Either CONTEXT_PARAM or LOID_PARAM indicating what type of string name is given next.
ObjName = Either a LOID, or a context path to an object

Return Values:
LOID of the indicated object's class.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing the LOID return value.

char*
GetMyLOID();

Returns the LOID of the running object(program).

Parameters: None

Return Values:
LOID of the current running program.

Error Return:
NULL

User Responsibility:
The user is responsible for "free"ing the LOID return value.

Directory of Legion 1.8 Manuals
[Home] [General] [Documentation] [Software]
[Testbeds] [Et Cetera] [Map/Search]

Free JavaScripts provided by The JavaScript Source

legion@Virginia.edu
http://legion.virginia.edu/