UM .NET API  6.16.1
com.latencybusters.lbm.sdm.LBMSDMFieldString Class Reference

Implements an SDM Field of type String. More...

Inheritance diagram for com.latencybusters.lbm.sdm.LBMSDMFieldString:
com.latencybusters.lbm.sdm.LBMSDMField com.latencybusters.lbm.sdm.LBMSDM com.latencybusters.lbm.sdm.LBMSDMArrayString

Public Member Functions

virtual System.String get ()
 Get the raw string field. More...
 
override int get_len ()
 Get the length of formatted field. More...
 
int get_base_len ()
 Get the length of formatted field This is used by the respective array class. More...
 
virtual void set (System.String v)
 Set the raw string. More...
 
 LBMSDMFieldString (System.String name)
 Constructor for an empty string field. More...
 
 LBMSDMFieldString (System.String name, System.String v)
 Constructor for a string field with a known string. More...
 
override System.String toDbgString ()
 Get a string useful for debugging. More...
 
override int format (byte[] buf, int offset)
 Format the string as a long string The formatted message will use a 4 byte length field to describe the string size. More...
 
override System.String ToString ()
 Get the string. More...
 
virtual int parse_name (byte[] buf, int offset)
 Parse a byte buffer and store the value as the name which is considered a short string. More...
 
override int parse (byte[] buf, int offset)
 Parse a byte buffer and store the value as the string value which is considered a long string. More...
 
override System.Object Clone ()
 Get a copy of this object. More...
 
virtual short getType ()
 Get the type of this field. More...
 
System.String getTypeString ()
 Get a string representing this field type. More...
 
virtual bool sameType (LBMSDMField f)
 Compare the type of the field to this field. More...
 
virtual bool sameBaseType (LBMSDMField f)
 Compare the base type of the field to this field. More...
 
virtual System.String get_name ()
 Get the field name. More...
 
virtual void set_name (System.String new_name)
 Set the name of this field. A copy of the name will be made. More...
 
virtual void set (LBMSDMField f, int arrayidx)
 This is overridden by array classes. More...
 
virtual void add_element (LBMSDMField newfield)
 Add an element to an array from a field. More...
 
virtual void append (LBMSDMField newfield)
 This is overridden by array classes. More...
 
virtual System.String internalString (System.String sname, System.String sval)
 Create a string based on the internal representation (includes the type) More...
 
virtual int name_len ()
 Get the length of this fields name in raw form. This is only needed by LBMSDMessage to format a raw message. More...
 
virtual int type_len ()
 Get the length of the type field in raw form. This is only needed by LBMSDMessage to format a raw message. More...
 
virtual int format_name (byte[] buf, int offset)
 Format into a byte buffer the name of this field. Only needed by LBMSDMessage to format messages. More...
 
virtual int format_type (byte[] buf, int offset)
 Format into a byte buffer the type of this field. Only needed by LBMSDMessage to format messages. More...
 
virtual int length ()
 Return the number of elements in an array. More...
 
virtual void remove (int element)
 Remove an element from an array class. More...
 
virtual bool isNull ()
 Test to see if this field is a null field (I.E. a field with no data) More...
 
virtual void setNull ()
 Set this field to a null value - discarding current value (if any)
 
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...
 

Static Public Member Functions

static int format_short (byte[] buf, int offset, System.String arbstr)
 Format a short string (less than 255 characters) The formatted message will use a 1 byte length field to describe the string size. More...
 
static int format_long (byte[] buf, int offset, System.String arbstr)
 Format a long string (greater than 255 characters) The formatted message will use a 4 byte length field to describe the string size. More...
 
static short getType (System.String typeName, bool isarray)
 Get the TYPE_XXX value for a given string. Recognised strings are: boolean, int8, uint8, int16, uint16, int32, uint32, int64, uint64, float, double, decimal, timestamp, message, string, unicode, blob. More...
 

Public Attributes

const int MAX_FIELD_NAME_LENGTH = 255
 Maximum length of a field name.
 
const short TYPE_INVALID = 0
 SDM field type: Type is invalid.
 
const short TYPE_BOOLEAN = 1
 SDM field type: Boolean (non-zero is true; zero is false).
 
const short TYPE_INT8 = 2
 SDM field type: 8-bit signed integer.
 
const short TYPE_UINT8 = 3
 SDM field type: 8-bit unsigned integer.
 
const short TYPE_INT16 = 4
 SDM field type: 16-bit signed integer.
 
const short TYPE_UINT16 = 5
 SDM field type: 16-bit unsigned integer.
 
const short TYPE_INT32 = 6
 SDM field type: 32-bit signed integer.
 
const short TYPE_UINT32 = 7
 SDM field type: 32-bit unsigned integer.
 
const short TYPE_INT64 = 8
 SDM field type: 64-bit signed integer.
 
const short TYPE_UINT64 = 9
 SDM field type: 64-bit unsigned integer.
 
const short TYPE_FLOAT = 10
 SDM field type: Single-precision floating point.
 
const short TYPE_DOUBLE = 11
 SDM field type: Double-precision floating point.
 
const short TYPE_DECIMAL = 12
 SDM field type: Decimal number.
 
const short TYPE_TIMESTAMP = 13
 SDM field type: Seconds and microseconds since the epoch (UTC).
 
const short TYPE_MESSAGE = 14
 SDM field type: Nested SDM message.
 
const short TYPE_STRING = 15
 SDM field type: Character string (ASCIZ).
 
const short TYPE_UNICODE = 16
 SDM field type: Unicode string.
 
const short TYPE_BLOB = 17
 SDM field type: Binary Large Object (BLOB).
 
const short TYPE_ARRAY_BOOLEAN = TYPE_BOOLEAN | TYPE_MODIFIER_ARRAY
 SDM field type: Array of Booleans (non-zero is true; zero is false).
 
const short TYPE_ARRAY_INT8 = TYPE_INT8 | TYPE_MODIFIER_ARRAY
 SDM field type: Array of 8-bit signed integers.
 
const short TYPE_ARRAY_UINT8 = (short) ((TYPE_UINT8 | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of 8-bit unsigned integers.
 
const short TYPE_ARRAY_INT16 = (short) ((TYPE_INT16 | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of 16-bit signed integers.
 
const short TYPE_ARRAY_UINT16 = (short) ((TYPE_UINT16 | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of 16-bit unsigned integers.
 
const short TYPE_ARRAY_INT32 = (short) ((TYPE_INT32 | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of 32-bit signed integers.
 
const short TYPE_ARRAY_UINT32 = (short) ((TYPE_UINT32 | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of 32-bit unsigned integers.
 
const short TYPE_ARRAY_INT64 = (short) ((TYPE_INT64 | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of 64-bit signed integers.
 
const short TYPE_ARRAY_UINT64 = (short) ((TYPE_UINT64 | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of 64-bit unsigned integers.
 
const short TYPE_ARRAY_FLOAT = (short) ((TYPE_FLOAT | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of single-precision floating points.
 
const short TYPE_ARRAY_DOUBLE = (short) ((TYPE_DOUBLE | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of double-precision floating points.
 
const short TYPE_ARRAY_DECIMAL = (short) ((TYPE_DECIMAL | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of decimal numbers.
 
const short TYPE_ARRAY_TIMESTAMP = (short) ((TYPE_TIMESTAMP | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of timestamps (seconds and microseconds since the epoch (UTC)).
 
const short TYPE_ARRAY_MESSAGE = (short) ((TYPE_MESSAGE | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of nested SDM messages.
 
const short TYPE_ARRAY_STRING = (short) ((TYPE_STRING | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of character strings (ASCIZ).
 
const short TYPE_ARRAY_UNICODE = (short) ((TYPE_UNICODE | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of unicode strings.
 
const short TYPE_ARRAY_BLOB = (short) ((TYPE_BLOB | TYPE_MODIFIER_ARRAY))
 SDM field type: Array of Binary Large Objects (BLOB).
 
const int DEBUG_BASIC = 1
 Debug flag for basic debug output.
 
const int DEBUG_VERBOSE_PARSING = 2
 Debug flag for verbose message parsing output.
 

Properties

virtual System.String TypeString [get]
 Get a string representing this field type. More...
 

Detailed Description

Implements an SDM Field of type String.

Constructor & Destructor Documentation

com.latencybusters.lbm.sdm.LBMSDMFieldString.LBMSDMFieldString ( System.String  name)

Constructor for an empty string field.

Parameters
nameThe field name
com.latencybusters.lbm.sdm.LBMSDMFieldString.LBMSDMFieldString ( System.String  name,
System.String  v 
)

Constructor for a string field with a known string.

Parameters
nameThe field name
vThe string to be used as the field value

Member Function Documentation

virtual void com.latencybusters.lbm.sdm.LBMSDMField.add_element ( LBMSDMField  newfield)
virtualinherited

Add an element to an array from a field.

Parameters
newfieldThe new field to be added

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldIterator.add_element().

override System.Object com.latencybusters.lbm.sdm.LBMSDMFieldString.Clone ( )
virtual

Get a copy of this object.

Returns
A new object with a copy

Reimplemented from com.latencybusters.lbm.sdm.LBMSDMField.

References com.latencybusters.lbm.sdm.LBMSDMFieldString.Clone().

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldString.Clone().

override int com.latencybusters.lbm.sdm.LBMSDMFieldString.format ( byte[]  buf,
int  offset 
)
virtual

Format the string as a long string The formatted message will use a 4 byte length field to describe the string size.

LBMSDMException when an unexpected error occurs within LBMSDM

Parameters
bufThe byte buffer to have the string formatted in
offsetThe offset to begin formatting in the buffer
Returns
The updated offset after formatting (points to an unused offset)

Reimplemented from com.latencybusters.lbm.sdm.LBMSDMField.

static int com.latencybusters.lbm.sdm.LBMSDMFieldString.format_long ( byte[]  buf,
int  offset,
System.String  arbstr 
)
static

Format a long string (greater than 255 characters) The formatted message will use a 4 byte length field to describe the string size.

LBMSDMException when an unexpected error occurs within LBMSDM

Parameters
bufThe byte buffer to have the string formatted in
offsetThe offset to begin formatting in the buffer
arbstrThe string to be formatted
Returns
The updated offset after formatting (points to an unused offset)
virtual int com.latencybusters.lbm.sdm.LBMSDMField.format_name ( byte[]  buf,
int  offset 
)
virtualinherited

Format into a byte buffer the name of this field. Only needed by LBMSDMessage to format messages.

LBMSDMException when an unexpected error occurs within LBMSDM

Parameters
bufThe buffer to format the message in to
offsetThe offset in to the byte buffer where the message should be placed
Returns
The new offset in the buffer after formatting the message name

References com.latencybusters.lbm.sdm.LBMSDMFieldString.format_short().

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.data().

static int com.latencybusters.lbm.sdm.LBMSDMFieldString.format_short ( byte[]  buf,
int  offset,
System.String  arbstr 
)
static

Format a short string (less than 255 characters) The formatted message will use a 1 byte length field to describe the string size.

LBMSDMNameTooLongException if the string exceeds 255 characters

LBMSDMException when an unexpected error occurs within LBMSDM

Parameters
bufThe byte buffer to have the string formatted in
offsetThe offset to begin formatting in the buffer
arbstrThe string to be formatted
Returns
The updated offset after formatting (points to an unused offset)

Referenced by com.latencybusters.lbm.sdm.LBMSDMField.format_name().

virtual int com.latencybusters.lbm.sdm.LBMSDMField.format_type ( byte[]  buf,
int  offset 
)
virtualinherited

Format into a byte buffer the type of this field. Only needed by LBMSDMessage to format messages.

LBMSDMException when an unexpected error occurs within LBMSDM

Parameters
bufThe buffer to format the type in to
offsetThe offset in to the byte buffer where the type should be placed
Returns
The new offset in the buffer after formatting the message type

References com.latencybusters.lbm.sdm.LBMSDMRawUint16.format(), and com.latencybusters.lbm.sdm.LBMSDMRawUint16.length.

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.data().

virtual System.String com.latencybusters.lbm.sdm.LBMSDMFieldString.get ( )
virtual

Get the raw string field.

Returns
The String

Reimplemented in com.latencybusters.lbm.sdm.LBMSDMArrayString.

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.parse().

int com.latencybusters.lbm.sdm.LBMSDMFieldString.get_base_len ( )

Get the length of formatted field This is used by the respective array class.

Returns
The number of bytes a formatted String will use
override int com.latencybusters.lbm.sdm.LBMSDMFieldString.get_len ( )
virtual

Get the length of formatted field.

Returns
The number of bytes a formatted String will use

Reimplemented from com.latencybusters.lbm.sdm.LBMSDMField.

virtual System.String com.latencybusters.lbm.sdm.LBMSDMField.get_name ( )
virtualinherited
static short com.latencybusters.lbm.sdm.LBMSDMField.getType ( System.String  typeName,
bool  isarray 
)
staticinherited

Get the TYPE_XXX value for a given string. Recognised strings are: boolean, int8, uint8, int16, uint16, int32, uint32, int64, uint64, float, double, decimal, timestamp, message, string, unicode, blob.

Parameters
typeNameA string which needs translating to a short form
isarrayA boolean indicating if an array type is required
Returns
A short representation for the string or TYPE_INVALID
virtual short com.latencybusters.lbm.sdm.LBMSDMField.getType ( )
virtualinherited

Get the type of this field.

Returns
The TYPE_XXX value of this object
System.String com.latencybusters.lbm.sdm.LBMSDMField.getTypeString ( )
inherited

Get a string representing this field type.

Returns
A string representing this field type
virtual System.String com.latencybusters.lbm.sdm.LBMSDMField.internalString ( System.String  sname,
System.String  sval 
)
virtualinherited

Create a string based on the internal representation (includes the type)

Parameters
snameThe field name
svalThe field value in string form
Returns
A string that contains the field name and value in ascii form
virtual bool com.latencybusters.lbm.sdm.LBMSDMField.isNull ( )
virtualinherited

Test to see if this field is a null field (I.E. a field with no data)

Returns
true/false
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 int com.latencybusters.lbm.sdm.LBMSDMField.name_len ( )
virtualinherited

Get the length of this fields name in raw form. This is only needed by LBMSDMessage to format a raw message.

Returns
the number of bytes the name of this field needs plus one for the length

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.data().

override int com.latencybusters.lbm.sdm.LBMSDMFieldString.parse ( byte[]  buf,
int  offset 
)
virtual

Parse a byte buffer and store the value as the string value which is considered a long string.

LBMSDMException when an unexpected error occurs within LBMSDM

Parameters
bufThe byte buffer to be parsed for the string value
offsetThe offset to begin parsing the buffer
Returns
The next offset to be parsed

Reimplemented from com.latencybusters.lbm.sdm.LBMSDMField.

virtual int com.latencybusters.lbm.sdm.LBMSDMFieldString.parse_name ( byte[]  buf,
int  offset 
)
virtual

Parse a byte buffer and store the value as the name which is considered a short string.

LBMSDMException when an unexpected error occurs within LBMSDM

Parameters
bufThe byte buffer to be parsed for the name
offsetThe offset to begin parsing the buffer
Returns
The next offset to be parsed

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.parse().

virtual bool com.latencybusters.lbm.sdm.LBMSDMField.sameBaseType ( LBMSDMField  f)
virtualinherited

Compare the base type of the field to this field.

Parameters
fA field to compare
Returns
true if the same type, false if not
virtual bool com.latencybusters.lbm.sdm.LBMSDMField.sameType ( LBMSDMField  f)
virtualinherited

Compare the type of the field to this field.

Parameters
fA field to compare
Returns
true if the same type, false if not
virtual void com.latencybusters.lbm.sdm.LBMSDMFieldString.set ( System.String  v)
virtual

Set the raw string.

Parameters
vThe LBMSDMRawBlob object to be set - it will be copied

Reimplemented in com.latencybusters.lbm.sdm.LBMSDMArrayString.

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 void com.latencybusters.lbm.sdm.LBMSDMField.set_name ( System.String  new_name)
virtualinherited

Set the name of this field. A copy of the name will be made.

Parameters
new_nameThe name this field shall use.
override System.String com.latencybusters.lbm.sdm.LBMSDMFieldString.toDbgString ( )
virtual

Get a string useful for debugging.

Returns
A string representation of this object

Reimplemented from com.latencybusters.lbm.sdm.LBMSDMField.

References com.latencybusters.lbm.sdm.LBMSDMRawUint32.format().

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

Get the string.

LBMSDMException when an unexpected error occurs within LBMSDM

Returns
The String

References com.latencybusters.lbm.sdm.LBMSDMFieldInt32.get(), and com.latencybusters.lbm.sdm.LBMSDMFieldInt32.parse().

virtual int com.latencybusters.lbm.sdm.LBMSDMField.type_len ( )
virtualinherited

Get the length of the type field in raw form. This is only needed by LBMSDMessage to format a raw message.

Returns
the number of bytes the type field needs

References com.latencybusters.lbm.sdm.LBMSDMFieldUint16.fixed_size().

Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.data().

Property Documentation

virtual System.String com.latencybusters.lbm.sdm.LBMSDMField.TypeString
getinherited

Get a string representing this field type.

Values: A string representing this field type

Returns
A string representing this field type

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