UM .NET API  6.16
com.latencybusters.lbm.sdm.LBMSDMessage Class Reference

LBMSDMessage is the main class for managing an LBM SDM message. It heavily relies on class LBMSDMFields to collect LBMSDMField and LBMSDMArray classes in to a message. LBMSDMessage is the primary interface for applications. More...

Inheritance diagram for com.latencybusters.lbm.sdm.LBMSDMessage:
com.latencybusters.lbm.sdm.LBMSDM

Public Member Functions

 LBMSDMessage ()
 Create an empty SDM message.
 
 LBMSDMessage (LBMSDMFieldsAttribute user_attr)
 Create an empty SDM message using a field set attribute. More...
 
 LBMSDMessage (LBMSDMFields args)
 Create an SDM message with a predefined set of fields. More...
 
virtual void set (LBMSDMFields args)
 Add to the SDM message a set of fields. This copies the reference, so the caller must retain the field set until the message no longer needs the field set. More...
 
virtual void set (LBMSDMField newfield)
 Set an SDM message field. The field name must exist already. More...
 
virtual void set (LBMSDMField newfield, int fieldidx)
 Set an SDM message field based on the message element index. The field must exist already. More...
 
virtual void set (LBMSDMField newfield, int fieldidx, int arrayidx)
 Set an SDM message field based on the message element index and the array index. More...
 
virtual LBMSDMFields get_fset ()
 Get the field set that is associated with this message. More...
 
virtual LBMSDMFieldsAttribute get_attr ()
 Get the field set attributes are associated with this message A copy is returned. More...
 
virtual void add (LBMSDMField f)
 Add a field to a message - the field set will be automatically created if needed. More...
 
virtual void remove (int pos)
 Remove a field by specifying the index. More...
 
virtual void remove (System.String name)
 Remove a field by specifying the name. More...
 
virtual void parse (byte[] buf, int offset)
 Parse a byte buffer containing a raw SDM message (as received on a socket) to fill the SDM message object. The byte buffer must be in network order. More...
 
virtual void parse (byte[] buf)
 Parse a byte buffer containing a raw SDM message (as received on a socket) to fill the SDM message object. The byte buffer must be in network order. More...
 
virtual byte[] data ()
 Get a byte buffer (array) to a raw SDM message in network order. This buffer can be transmitted, for example via a socket. More...
 
virtual System.String toDbgString ()
 Dump an internal (ascii) representation of this message. More...
 
override System.String ToString ()
 Dump a string (ascii) representation of this message. More...
 
virtual new System.Object Clone ()
 Clone an SDM message. More...
 
virtual bool test_clone (LBMSDMessage m)
 An api that is used during testing to ensure that cloned objects are truly cloned. This API is not for general use. More...
 
virtual LBMSDMField locate (System.String name)
 Locate a field by name. More...
 
virtual int count ()
 Count the number of fields in a message. More...
 
virtual int length ()
 Get the raw length of the message. This API will rebuild the message. It is more efficient to call data() and get the length of the returned array instead of calling data() and length() More...
 
virtual LBMSDMField get (int pos)
 Get a field by the index. More...
 
virtual void set_debug_level (int level)
 Set the debug level for processing this SDM message. Currently all debugs go to standard out. More...
 
virtual void log (System.String s)
 Log an event. If debug level is set greater than 0, output to stderr. More...
 

Public Attributes

const int DEBUG_BASIC = 1
 Debug flag for basic debug output.
 
const int DEBUG_VERBOSE_PARSING = 2
 Debug flag for verbose message parsing output.
 

Detailed Description

LBMSDMessage is the main class for managing an LBM SDM message. It heavily relies on class LBMSDMFields to collect LBMSDMField and LBMSDMArray classes in to a message. LBMSDMessage is the primary interface for applications.

Constructor & Destructor Documentation

com.latencybusters.lbm.sdm.LBMSDMessage.LBMSDMessage ( LBMSDMFieldsAttribute  user_attr)

Create an empty SDM message using a field set attribute.

Parameters
user_attrA field set attribute object
com.latencybusters.lbm.sdm.LBMSDMessage.LBMSDMessage ( LBMSDMFields  args)

Create an SDM message with a predefined set of fields.

Parameters
argsThe set of fields to be added to the SDM message

Member Function Documentation

virtual void com.latencybusters.lbm.sdm.LBMSDMessage.add ( LBMSDMField  f)
virtual

Add a field to a message - the field set will be automatically created if needed.

Parameters
fThe LBMSDMField object to be added

References com.latencybusters.lbm.sdm.LBMSDMFields.add().

virtual new System.Object com.latencybusters.lbm.sdm.LBMSDMessage.Clone ( )
virtual
virtual int com.latencybusters.lbm.sdm.LBMSDMessage.count ( )
virtual

Count the number of fields in a message.

Returns
The number of fields in the message

References com.latencybusters.lbm.sdm.LBMSDMFields.length().

virtual LBMSDMField com.latencybusters.lbm.sdm.LBMSDMessage.get ( int  pos)
virtual

Get a field by the index.

Parameters
posThe index of the field required
Returns
The LBMSDMField object

References com.latencybusters.lbm.sdm.LBMSDMFields.get().

Referenced by com.latencybusters.lbm.sdm.LBMSDMArrayMessage.set().

virtual LBMSDMFieldsAttribute com.latencybusters.lbm.sdm.LBMSDMessage.get_attr ( )
virtual

Get the field set attributes are associated with this message A copy is returned.

Returns
LBMSDMFieldsAttribute object

References com.latencybusters.lbm.sdm.LBMSDMFields.get_attr().

virtual LBMSDMFields com.latencybusters.lbm.sdm.LBMSDMessage.get_fset ( )
virtual

Get the field set that is associated with this message.

Returns
LBMSDMFields object
virtual int com.latencybusters.lbm.sdm.LBMSDMessage.length ( )
virtual

Get the raw length of the message. This API will rebuild the message. It is more efficient to call data() and get the length of the returned array instead of calling data() and length()

Returns
The number of bytes the message will use

Referenced by com.latencybusters.lbm.sdm.LBMSDMArrayMessage.get_len(), and com.latencybusters.lbm.sdm.LBMSDMFieldMessage.toDbgString().

virtual LBMSDMField com.latencybusters.lbm.sdm.LBMSDMessage.locate ( System.String  name)
virtual

Locate a field by name.

Parameters
nameName of field being located
Returns
The relevant LBMSDMField or null

References com.latencybusters.lbm.sdm.LBMSDMFields.locate().

virtual void com.latencybusters.lbm.sdm.LBMSDM.log ( System.String  s)
virtualinherited

Log an event. If debug level is set greater than 0, output to stderr.

Parameters
sString containing the event to log
virtual void com.latencybusters.lbm.sdm.LBMSDMessage.parse ( byte[]  buf,
int  offset 
)
virtual

Parse a byte buffer containing a raw SDM message (as received on a socket) to fill the SDM message object. The byte buffer must be in network order.

for example if the message has bad data

LBMSDMException if a problem occurs parsing the message buffer,

Parameters
bufThe byte array (buffer) containing the raw SDM message to be parsed
offsetThe index in the array where parsing should start

References com.latencybusters.lbm.sdm.LBMSDMFieldUint16.get(), com.latencybusters.lbm.sdm.LBMSDMFieldUint32.get(), com.latencybusters.lbm.sdm.LBMSDMFieldString.get(), com.latencybusters.lbm.sdm.LBMSDMFieldUint16.parse(), com.latencybusters.lbm.sdm.LBMSDMFieldUint32.parse(), com.latencybusters.lbm.sdm.LBMSDMField.parse(), com.latencybusters.lbm.sdm.LBMSDMFieldString.parse_name(), com.latencybusters.lbm.sdm.LBMSDMField.toDbgString(), com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_BLOB, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_BOOLEAN, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_DECIMAL, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_DOUBLE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_FLOAT, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_INT16, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_INT32, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_INT64, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_INT8, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_MESSAGE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_STRING, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_TIMESTAMP, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UINT16, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UINT32, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UINT64, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UINT8, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_ARRAY_UNICODE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_BLOB, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_BOOLEAN, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_DECIMAL, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_DOUBLE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_FLOAT, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_INT16, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_INT32, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_INT64, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_INT8, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_MESSAGE, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_STRING, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_TIMESTAMP, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UINT16, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UINT32, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UINT64, com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UINT8, and com.latencybusters.lbm.sdm.LBMSDMField.TYPE_UNICODE.

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldMessage.Clone(), and com.latencybusters.lbm.sdm.LBMSDMFieldMessage.parse().

virtual void com.latencybusters.lbm.sdm.LBMSDMessage.parse ( byte[]  buf)
virtual

Parse a byte buffer containing a raw SDM message (as received on a socket) to fill the SDM message object. The byte buffer must be in network order.

for example if the message has bad data

LBMSDMException if a problem occurs parsing the message buffer

Parameters
bufThe byte array (buffer) containing the raw SDM message to be parsed
virtual void com.latencybusters.lbm.sdm.LBMSDMessage.remove ( int  pos)
virtual

Remove a field by specifying the index.

Parameters
posThe index of the field

References com.latencybusters.lbm.sdm.LBMSDMFields.remove().

virtual void com.latencybusters.lbm.sdm.LBMSDMessage.remove ( System.String  name)
virtual

Remove a field by specifying the name.

Parameters
nameThe field name to be removed

References com.latencybusters.lbm.sdm.LBMSDMFields.remove().

virtual void com.latencybusters.lbm.sdm.LBMSDMessage.set ( LBMSDMFields  args)
virtual

Add to the SDM message a set of fields. This copies the reference, so the caller must retain the field set until the message no longer needs the field set.

See also
LBMSDMFields
Parameters
argsThe set of fields to be added to the SDM message
virtual void com.latencybusters.lbm.sdm.LBMSDMessage.set ( LBMSDMField  newfield)
virtual

Set an SDM message field. The field name must exist already.

LBMSDMAddingFieldException when the field doesn't exist

Parameters
newfieldThe new field

References com.latencybusters.lbm.sdm.LBMSDMFields.set().

virtual void com.latencybusters.lbm.sdm.LBMSDMessage.set ( LBMSDMField  newfield,
int  fieldidx 
)
virtual

Set an SDM message field based on the message element index. The field must exist already.

LBMSDMAddingFieldException when the field doesn't exist

Parameters
newfieldThe new field
fieldidxThe field index in the message

References com.latencybusters.lbm.sdm.LBMSDMFields.set().

virtual void com.latencybusters.lbm.sdm.LBMSDMessage.set ( LBMSDMField  newfield,
int  fieldidx,
int  arrayidx 
)
virtual

Set an SDM message field based on the message element index and the array index.

LBMSDMAddingFieldException when the field doesn't exist

Parameters
newfieldThe new field
fieldidxThe field index in the message
arrayidxThe array index in the field

References com.latencybusters.lbm.sdm.LBMSDMFields.set().

virtual void com.latencybusters.lbm.sdm.LBMSDM.set_debug_level ( int  level)
virtualinherited

Set the debug level for processing this SDM message. Currently all debugs go to standard out.

Parameters
levelDebug level to set
virtual bool com.latencybusters.lbm.sdm.LBMSDMessage.test_clone ( LBMSDMessage  m)
virtual

An api that is used during testing to ensure that cloned objects are truly cloned. This API is not for general use.

Parameters
mAn SDM message object to test against this object
Returns
true if fields are identical (should not be if correctly cloned)
virtual System.String com.latencybusters.lbm.sdm.LBMSDMessage.toDbgString ( )
virtual

Dump an internal (ascii) representation of this message.

Returns
A string containing the message

References com.latencybusters.lbm.sdm.LBMSDMFields.toDbgString().

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldMessage.toDbgString().

override System.String com.latencybusters.lbm.sdm.LBMSDMessage.ToString ( )

Dump a string (ascii) representation of this message.

Returns
A string containing the message

References com.latencybusters.lbm.sdm.LBMSDMFields.toDbgString().


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