UM Java API  6.16
com.latencybusters.lbm.sdm.LBMSDMRawTimestamp Class Reference
Inheritance diagram for com.latencybusters.lbm.sdm.LBMSDMRawTimestamp:
com.latencybusters.lbm.sdm.LBMSDMRaw com.latencybusters.lbm.sdm.LBMSDM

Public Member Functions

void set (long s, long m) throws LBMSDMException
 
 LBMSDMRawTimestamp () throws LBMSDMException
 
 LBMSDMRawTimestamp (long s, long m) throws LBMSDMException
 
 LBMSDMRawTimestamp (String s) throws LBMSDMException
 
long get_sec () throws LBMSDMException
 
long get_usec () throws LBMSDMException
 
String toString ()
 
int format (byte[] buf, int offset) throws LBMSDMException
 
int parse (byte[] buf, int offset) throws LBMSDMException
 
LBMSDMRawTimestamp clone () throws CloneNotSupportedException
 
String toDbgString ()
 
void set_debug_level (int level)
 
void log (String s)
 

Static Public Attributes

static int length = 8
 
static final int DEBUG_BASIC = 1
 
static final int DEBUG_VERBOSE_PARSING = 2
 

Protected Attributes

int debug_level = 0
 

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 ( ) throws LBMSDMException

Create a raw timestamp field, defaulting to 0

Referenced by com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.clone().

com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.LBMSDMRawTimestamp ( long  s,
long  m 
) throws LBMSDMException

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
Exceptions
LBMSDMUnsignedExceptionif an unsigned value is passed in
com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.LBMSDMRawTimestamp ( String  s) throws LBMSDMException

Set a raw timestamp field providing a string formatted timestamp

Parameters
sThe string containing the time ("sec.micro" or "now")
Exceptions
LBMSDMUnsignedExceptionif an unsigned value is passed in

Member Function Documentation

int com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.format ( byte []  buf,
int  offset 
) throws LBMSDMException

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(), and com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.length.

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

long com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.get_sec ( ) throws LBMSDMException

Get the number of seconds since epoch

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

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

Returns
The number of seconds since the start of the current second
int com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.parse ( byte []  buf,
int  offset 
) throws LBMSDMException

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.LBMSDMRawTimestamp.length, and com.latencybusters.lbm.sdm.LBMSDMRawUint32.parse().

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

void com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.set ( long  s,
long  m 
) throws LBMSDMException

Set a uint32 field providing the value as a long

Parameters
sThe number of seconds since epoch
mThe number of microseconds since epoch
Exceptions
LBMSDMUnsignedExceptionif an unsigned value is passed in

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

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

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

String com.latencybusters.lbm.sdm.LBMSDMRaw.toDbgString ( )
inherited

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().

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.

Member Data Documentation

final int com.latencybusters.lbm.sdm.LBMSDM.DEBUG_BASIC = 1
staticinherited

Debug flag for basic debug output

int com.latencybusters.lbm.sdm.LBMSDM.debug_level = 0
protectedinherited
final int com.latencybusters.lbm.sdm.LBMSDM.DEBUG_VERBOSE_PARSING = 2
staticinherited

Debug flag for verbose message parsing output


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