LibMC::MCAclMessage Class Reference

Encapsulates ACL messages in the Mobile-C library. More...


Public Types

enum  MC_FipaPerformative_e
 Enum for describing the type of an ACL message. More...

Public Member Functions

 MCAclMessage ()
 Default constructor.
void New ()
 Creates a new, blank ACL message.
MCAclMessage Reply (MCAclMessage acl_message)
 Creates an ACL message that is a response to the argument.
int SetPerformative (MC_FipaPerformative_e performative)
 Sets the performative field of the message.
int SetSender (String name, String address)
 Sets the sender field of the message.
int AddReceiver (String name, String address)
 Adds a receiver to the list of receivers.
int AddReplyTo (String name, String address)
 Adds a "reply-to" field to the message.
int SetContent (String content)
 Sets the content field of the message.
int Destroy ()
 Destroys a message.

Properties

internal IntPtr AclMsg [get, set]

Private Member Functions

internal MCAclMessage (IntPtr msg)

Private Attributes

IntPtr aclmsg_p


Detailed Description

Encapsulates ACL messages in the Mobile-C library.

This class contains a pointer to an ACL message in the Mobile-C library. Functions are provided to send the message, set its various fields, and destory the message.

Definition at line 72 of file MCAclMessage.cs.


Member Enumeration Documentation

Enum for describing the type of an ACL message.

Note:
This enum is pulled directly from the Mobile-C library.
Enumerator:
FIPA_ERROR  Fipa performative enum value
FIPA_ZERO  Fipa performative enum value
FIPA_ACCEPT_PROPOSAL  Fipa performative enum value
FIPA_AGREE  Fipa performative enum value
FIPA_CANCEL  Fipa performative enum value
FIPA_CALL_FOR_PROPOSAL  Fipa performative enum value
FIPA_CONFIRM  Fipa performative enum value
FIPA_DISCONFIRM  Fipa performative enum value
FIPA_FAILURE  Fipa performative enum value
FIPA_INFORM  Fipa performative enum value
FIPA_INFORM_IF  Fipa performative enum value
FIPA_INFORM_REF  Fipa performative enum value
FIPA_NOT_UNDERSTOOD  Fipa performative enum value
FIPA_PROPOGATE  Fipa performative enum value
FIPA_PROPOSE  Fipa performative enum value
FIPA_PROXY  Fipa performative enum value
FIPA_QUERY_IF  Fipa performative enum value
FIPA_QUERY_REF  Fipa performative enum value
FIPA_REFUSE  Fipa performative enum value
FIPA_REJECT_PROPOSAL  Fipa performative enum value
FIPA_REQUEST  Fipa performative enum value
FIPA_REQUEST_WHEN  Fipa performative enum value
FIPA_REQUEST_WHENEVER  Fipa performative enum value
FIPA_SUBSCRIBE  Fipa performative enum value

Definition at line 79 of file MCAclMessage.cs.


Constructor & Destructor Documentation

LibMC::MCAclMessage::MCAclMessage (  )  [inline]

Default constructor.

Creates an empty ACL message object.

Definition at line 114 of file MCAclMessage.cs.

References aclmsg_p.

Referenced by Reply().

internal LibMC::MCAclMessage::MCAclMessage ( IntPtr  msg  )  [inline, private]

Definition at line 120 of file MCAclMessage.cs.

References AclMsg.


Member Function Documentation

void LibMC::MCAclMessage::New (  )  [inline]

Creates a new, blank ACL message.

Creates a new ACL message. The message is blank but valid.

Definition at line 153 of file MCAclMessage.cs.

References AclMsg.

MCAclMessage LibMC::MCAclMessage::Reply ( MCAclMessage  acl_message  )  [inline]

Creates an ACL message that is a response to the argument.

Creates an ACL message to respond to the argument.

Parameters:
acl_message The message from which to create the reply.
Returns:
A new ACL message that is a response to the argument or an empty message if there is an error.

Definition at line 167 of file MCAclMessage.cs.

References AclMsg, and MCAclMessage().

int LibMC::MCAclMessage::SetPerformative ( MC_FipaPerformative_e  performative  )  [inline]

Sets the performative field of the message.

Sets the performative field of the message.

Parameters:
performative The fipa_performative_e enum describing the message.
Returns:
The return value of the underlying MC_AclSetPerformative function.
Note:
The message must be a valid message or this function will fail.

Definition at line 186 of file MCAclMessage.cs.

References AclMsg.

int LibMC::MCAclMessage::SetSender ( String  name,
String  address 
) [inline]

Sets the sender field of the message.

Sets the performative field of the message.

Parameters:
name The name of the sending entity.
address The address of the sending entity.
Returns:
The return value of the underlying MC_AclSetSender function.
Note:
The message must be a valid message or this function will fail.

Definition at line 202 of file MCAclMessage.cs.

References AclMsg.

int LibMC::MCAclMessage::AddReceiver ( String  name,
String  address 
) [inline]

Adds a receiver to the list of receivers.

Adds a receiver to the list of receivers for the message.

Parameters:
name The name of the receiver.
address The address of the receiver.
Returns:
The return value of the underlying MC_AclAddReceiver function.
Note:
The message must be a valid message or this function will fail.

Definition at line 218 of file MCAclMessage.cs.

References AclMsg.

int LibMC::MCAclMessage::AddReplyTo ( String  name,
String  address 
) [inline]

Adds a "reply-to" field to the message.

Adds a "reply-to" field to the message. The reply-to field overrides the sender field when creating a reply.

Parameters:
name The name of the receiver.
address The address of the receiver.
Returns:
The return value of the underlying MC_AclAddAddReplyTo function.
Note:
The message must be a valid message or this function will fail.

Definition at line 235 of file MCAclMessage.cs.

References AclMsg.

int LibMC::MCAclMessage::SetContent ( String  content  )  [inline]

Sets the content field of the message.

Sets the content field of the message.

Parameters:
content The string to copy to the content field.
Returns:
The return value of the underlying MC_AclSetContent function.
Note:
The message must be a valid message or this function will fail.

Definition at line 250 of file MCAclMessage.cs.

References AclMsg.

int LibMC::MCAclMessage::Destroy (  )  [inline]

Destroys a message.

This function destroys a message in the Mobile-C library. It releases the underlying memory and must be called when the message is no longer needed.

Returns:
The return value of the underlying MC_AclDestroy function.
Note:
The message must be a valid message or this function will fail. In addition, messages are not automatically destroyed by the garbage collector. Use care when creating messages and ensure they are properly destroyed.

Definition at line 269 of file MCAclMessage.cs.

References AclMsg, and aclmsg_p.


Field Documentation

Definition at line 105 of file MCAclMessage.cs.

Referenced by Destroy(), and MCAclMessage().


Property Documentation

internal IntPtr LibMC::MCAclMessage::AclMsg [get, set, private]


The documentation for this class was generated from the following file:

Generated on Thu Nov 13 14:22:59 2008 for Mobile-C by  doxygen 1.5.5