Wrapper class for MCAgent_t structure. More...
Public Types | |
enum | MC_AgentType_e { MC_NONE = -1, MC_REMOTE_AGENT = 0, MC_LOCAL_AGENT, MC_RETURN_AGENT } |
Enum for describing the type of an agent. More... | |
enum | MC_AgentStatus_e { MC_NO_STATUS = -1, MC_WAIT_CH = 0, MC_WAIT_MESSGSEND, MC_AGENT_ACTIVE, MC_AGENT_NEUTRAL, MC_AGENT_SUSPENDED, MC_WAIT_FINISHED } |
Enum for describing the status of an agent. More... | |
Public Member Functions | |
MCAgent () | |
Default constructor. | |
override string | ToString () |
Display the agent's fields. | |
int | DeleteAgent () |
Deletes an agent. | |
String | GetAgentXMLString () |
Gets the agent's XML string. | |
int | PrintAgentCode () |
Gets the agent's C code string. | |
String | RetrieveAgentCode () |
Gets the agent's C code string. | |
int | TerminateAgent () |
Terminates an agent. | |
int | AclPost (MCAclMessage message) |
Posts an ACL message to the agent. | |
MCAclMessage | AclRetrieve () |
Retrieve an ACL message from the agent. | |
MCAclMessage | AclWaitRetrieve () |
Wait for and retrieve an ACL message from the agent. | |
int | CallAgentFunc (String funcName, IntPtr retval, IntPtr varg) |
Calls a function in an agent script. | |
int | CallAgentFunc (String funcName, ref object retval, ref object varg) |
Calls a function in an agent script. | |
IntPtr | GetAgentExecEngine () |
Gets an agent's Ch interpreter. | |
int | GetAgentReturnData (int task_num, IntPtr data, IntPtr dim, IntPtr extent) |
Calls a function in an agent script. | |
Static Public Member Functions | |
static implicit | operator IntPtr (MCAgent agent) |
static implicit | operator MCAgent (IntPtr ip) |
Properties | |
internal IntPtr | Agent [get, set] |
int | AgentID [get] |
Gets the agent's ID number. | |
String | AgentName [get] |
Gets the agent's name. | |
int | AgentNumTasks [get] |
Gets the agent's number of tasks. | |
MC_AgentStatus_e | AgentStatus [get, set] |
Gets or sets the agent's status. | |
MC_AgentType_e | AgentType [get] |
Gets the agent's type. | |
bool | Valid [get] |
Checks whether the agent is valid. | |
Private Member Functions | |
internal | MCAgent (IntPtr ip) |
void | GetAgentFields () |
Private Attributes | |
IntPtr | agent_p |
String | name = "" |
int | id = -1 |
int | numTasks = -1 |
MC_AgentStatus_e | status = MC_AgentStatus_e.MC_NO_STATUS |
MC_AgentType_e | type = MC_AgentType_e.MC_NONE |
Wrapper class for MCAgent_t structure.
This class provides an interface to the Mobile-C agent structure. Member functions for the class are generally overloaded versions of the respective functions in the Mobile-C library. The class maintains a pointer to a Mobile-C agent in unmanaged memory. The pointer is not accessible by the user.
Definition at line 61 of file MCAgent.cs.
Enum for describing the status of an agent.
Definition at line 88 of file MCAgent.cs.
Enum for describing the type of an agent.
MC_NONE |
Default value to describe unininitialized agent. |
MC_REMOTE_AGENT |
A remote agent. |
MC_LOCAL_AGENT |
A local agent. |
MC_RETURN_AGENT |
A returning agent. |
Definition at line 75 of file MCAgent.cs.
LibMC::MCAgent::MCAgent | ( | ) | [inline] |
Default constructor.
Creates an empty agent.
Definition at line 104 of file MCAgent.cs.
Referenced by operator MCAgent().
internal LibMC::MCAgent::MCAgent | ( | IntPtr | ip | ) | [inline, private] |
Definition at line 110 of file MCAgent.cs.
References Agent.
int LibMC::MCAgent::AclPost | ( | MCAclMessage | message | ) | [inline] |
Posts an ACL message to the agent.
Delivers an ACL message to the agent.
message | The ACL message object to deliver. |
Definition at line 397 of file MCAgent.cs.
References LibMC::MCAclMessage::AclMsg, and Agent.
MCAclMessage LibMC::MCAgent::AclRetrieve | ( | ) | [inline] |
Retrieve an ACL message from the agent.
Retrieves an ACL message from the agent if one is available.
Definition at line 413 of file MCAgent.cs.
References Agent.
MCAclMessage LibMC::MCAgent::AclWaitRetrieve | ( | ) | [inline] |
Wait for and retrieve an ACL message from the agent.
Retrieves an ACL message from the agent when one becomes available.
Definition at line 432 of file MCAgent.cs.
References Agent.
int LibMC::MCAgent::CallAgentFunc | ( | String | funcName, | |
ref object | retval, | |||
ref object | varg | |||
) | [inline] |
Calls a function in an agent script.
Calls a function in an agent's script file. This function requires boxing of parameters, but no marshaling.
funcName | The name of the function to call | |
retval | A boxed object to hold the return value | |
varg | The boxed argument to the agent function |
Definition at line 488 of file MCAgent.cs.
References CallAgentFunc().
int LibMC::MCAgent::CallAgentFunc | ( | String | funcName, | |
IntPtr | retval, | |||
IntPtr | varg | |||
) | [inline] |
Calls a function in an agent script.
Calls a function in an agent's script file. This function requires manual marshaling by the user.
funcName | The name of the function to call | |
retval | A pointer to memory for the return value | |
varg | A pointer to the argument for the function |
Definition at line 458 of file MCAgent.cs.
References Agent.
Referenced by CallAgentFunc().
int LibMC::MCAgent::DeleteAgent | ( | ) | [inline] |
Deletes an agent.
Deletes an agent from the agency.
Definition at line 321 of file MCAgent.cs.
References Agent.
IntPtr LibMC::MCAgent::GetAgentExecEngine | ( | ) | [inline] |
Gets an agent's Ch interpreter.
Gets a pointer to the agent's Ch interpreter. Will be improved shortly.
Definition at line 533 of file MCAgent.cs.
References Agent.
void LibMC::MCAgent::GetAgentFields | ( | ) | [inline, private] |
int LibMC::MCAgent::GetAgentReturnData | ( | int | task_num, | |
IntPtr | data, | |||
IntPtr | dim, | |||
IntPtr | extent | |||
) | [inline] |
Calls a function in an agent script.
Calls a function in an agent's script file. This function requires manual marshaling by the user.
task_num | Task number to get data from | |
data | A pointer to memory for the data | |
dim | A pointer to hold the dimensions of the data | |
extent | A pointer to hold the dimensions of the data |
Definition at line 554 of file MCAgent.cs.
String LibMC::MCAgent::GetAgentXMLString | ( | ) | [inline] |
Gets the agent's XML string.
Returns the full XML string associated with the agent.
Definition at line 334 of file MCAgent.cs.
References Agent.
static implicit LibMC::MCAgent::operator IntPtr | ( | MCAgent | agent | ) | [inline, static] |
Definition at line 299 of file MCAgent.cs.
References Agent.
static implicit LibMC::MCAgent::operator MCAgent | ( | IntPtr | ip | ) | [inline, static] |
Definition at line 304 of file MCAgent.cs.
References MCAgent().
int LibMC::MCAgent::PrintAgentCode | ( | ) | [inline] |
Gets the agent's C code string.
Prints the C code associated with the agent to stdout.
Definition at line 347 of file MCAgent.cs.
References Agent.
String LibMC::MCAgent::RetrieveAgentCode | ( | ) | [inline] |
Gets the agent's C code string.
Returns the C code associated with the agent.
Definition at line 359 of file MCAgent.cs.
References Agent.
int LibMC::MCAgent::TerminateAgent | ( | ) | [inline] |
Terminates an agent.
Terminates an agent regardless of the agent's state.
Definition at line 372 of file MCAgent.cs.
References Agent.
override string LibMC::MCAgent::ToString | ( | ) | [inline] |
Display the agent's fields.
Formats an returns a string with all of the agents properties.
Definition at line 126 of file MCAgent.cs.
References AgentID, AgentName, AgentNumTasks, AgentStatus, and AgentType.
IntPtr LibMC::MCAgent::agent_p [private] |
Definition at line 63 of file MCAgent.cs.
int LibMC::MCAgent::id = -1 [private] |
Definition at line 65 of file MCAgent.cs.
String LibMC::MCAgent::name = "" [private] |
Definition at line 64 of file MCAgent.cs.
Referenced by GetAgentFields().
int LibMC::MCAgent::numTasks = -1 [private] |
Definition at line 66 of file MCAgent.cs.
Referenced by GetAgentFields().
MC_AgentStatus_e LibMC::MCAgent::status = MC_AgentStatus_e.MC_NO_STATUS [private] |
Definition at line 67 of file MCAgent.cs.
Referenced by GetAgentFields().
MC_AgentType_e LibMC::MCAgent::type = MC_AgentType_e.MC_NONE [private] |
Definition at line 68 of file MCAgent.cs.
Referenced by GetAgentFields().
internal IntPtr LibMC::MCAgent::Agent [get, set, private] |
Definition at line 143 of file MCAgent.cs.
Referenced by AclPost(), AclRetrieve(), AclWaitRetrieve(), LibMC::MCAgency::AddAgent(), CallAgentFunc(), DeleteAgent(), GetAgentExecEngine(), GetAgentFields(), GetAgentXMLString(), MCAgent(), operator IntPtr(), PrintAgentCode(), LibMC::MCAgency::RegisterService(), RetrieveAgentCode(), and TerminateAgent().
int LibMC::MCAgent::AgentID [get] |
Gets the agent's ID number.
Gets the agent's ID number as assigned by Mobile-C if the agent is a valid agent.
Definition at line 181 of file MCAgent.cs.
Referenced by ToString().
String LibMC::MCAgent::AgentName [get] |
Gets the agent's name.
Gets the agent's name as assigned by Mobile-C or the agent script if the agent is a valid agent.
Definition at line 201 of file MCAgent.cs.
Referenced by ToString().
int LibMC::MCAgent::AgentNumTasks [get] |
Gets the agent's number of tasks.
Gets the agent's ID number of tasks if the agent is a valid agent.
Definition at line 220 of file MCAgent.cs.
Referenced by ToString().
MC_AgentStatus_e LibMC::MCAgent::AgentStatus [get, set] |
Gets or sets the agent's status.
Gets or sets the agent's status. When setting the status, the status is double-checked after setting it and may not be set depending on the state of the agent and the agency.
Definition at line 242 of file MCAgent.cs.
Referenced by ToString().
MC_AgentType_e LibMC::MCAgent::AgentType [get] |
Gets the agent's type.
Gets the agent's type.
Definition at line 264 of file MCAgent.cs.
Referenced by ToString().
bool LibMC::MCAgent::Valid [get] |
Checks whether the agent is valid.
Checks the internal agent pointer to see if it is non-zero.
Definition at line 285 of file MCAgent.cs.