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

An LBMSDMRawTimestamp is a helper class to minimise the effort of formatting and parsing Timestamps. A Timestamp is the number of seconds and microseconds since Unix epoch. More...

Inheritance diagram for com.latencybusters.lbm.sdm.LBMSDMRawTimestamp:
com.latencybusters.lbm.sdm.LBMSDMRaw com.latencybusters.lbm.sdm.LBMSDM

Public Member Functions

virtual void set (uint s, uint m)
 Set a uint32 field providing the value as a long. More...
 
 LBMSDMRawTimestamp ()
 Create a raw timestamp field, defaulting to 0.
 
 LBMSDMRawTimestamp (uint s, uint m)
 Set a raw timestamp field providing the seconds and microseconds since UNIX epoch. More...
 
 LBMSDMRawTimestamp (System.String s)
 Set a raw timestamp field providing a string formatted timestamp. More...
 
 LBMSDMRawTimestamp (System.DateTime dt)
 Set a raw timestamp field providing a string formatted timestamp in the form sec.micro or "now". More...
 
virtual long get_sec ()
 Get the number of seconds since epoch. More...
 
virtual long get_usec ()
 Get the number of microseconds since the start of the current second. More...
 
override System.String ToString ()
 Get a string version of a timestamp. More...
 
virtual int format (byte[] buf, int offset)
 Format the raw timestamp value into a byte buffer. More...
 
virtual int parse (byte[] buf, int offset)
 Parse the raw timestamp value from a byte buffer. More...
 
virtual new System.Object Clone ()
 Get a copy of this object. More...
 
virtual System.String toDbgString ()
 Get a debug string for this object. This is not expected to be called and exists for child classes. 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.
 

Static Public Attributes

static int length = 8
 The number of bytes needed to store a raw LBMSDMRawTimestamp.
 

Detailed Description

An LBMSDMRawTimestamp is a helper class to minimise the effort of formatting and parsing Timestamps. A Timestamp is the number of seconds and microseconds since Unix epoch.

Constructor & Destructor Documentation

com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.LBMSDMRawTimestamp ( uint  s,
uint  m 
)

Set a raw timestamp field providing the seconds and microseconds since UNIX epoch.

Parameters
sThe number of seconds since epoch
mThe number of microseconds since epoch
com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.LBMSDMRawTimestamp ( System.String  s)

Set a raw timestamp field providing a string formatted timestamp.

Parameters
sThe string containing the time ("sec.micro" or "now")
com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.LBMSDMRawTimestamp ( System.DateTime  dt)

Set a raw timestamp field providing a string formatted timestamp in the form sec.micro or "now".

Parameters
dtThe C# DateTime object to be stored as a timestamp

Member Function Documentation

virtual new System.Object com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.Clone ( )
virtual
virtual int com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.format ( byte[]  buf,
int  offset 
)
virtual

Format the raw timestamp value into a byte buffer.

Parameters
bufThe buffer to contain the formatted value
offsetThe offset in to the buffer to start formatting
Returns
The offset after formatting this object

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

Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldTimestamp.format(), and com.latencybusters.lbm.sdm.LBMSDMArrayTimestamp.format().

virtual long com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.get_sec ( )
virtual

Get the number of seconds since epoch.

Returns
The number of seconds since epoch
virtual long com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.get_usec ( )
virtual

Get the number of microseconds since the start of the current second.

Returns
The number of seconds since the start of the current second
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.LBMSDMRawTimestamp.parse ( byte[]  buf,
int  offset 
)
virtual

Parse the raw timestamp value from a byte buffer.

Parameters
bufThe buffer that contains the formatted value
offsetThe offset in to the buffer to start parsing
Returns
the new offset after parsing the field

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

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

virtual void com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.set ( uint  s,
uint  m 
)
virtual

Set a uint32 field providing the value as a long.

Parameters
sThe number of seconds since epoch (1 Jan 1970)
mThe number of microseconds since epoch (1 Jan 1970)

References com.latencybusters.lbm.sdm.LBMSDMRawUint32.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 System.String com.latencybusters.lbm.sdm.LBMSDMRaw.toDbgString ( )
virtualinherited

Get a debug string for this object. This is not expected to be called and exists for child classes.

Returns
returns null - derived classes override with their value

Referenced by com.latencybusters.lbm.sdm.LBMSDMBadRawObjectException.LBMSDMBadRawObjectException().

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

Get a string version of a timestamp.

Returns
A string representation of the timestamp in the format, "seconds.microseconds", which is not a floating point representation of the time.

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