iso::base::Tools Class Reference

singleton class providing a basic set basic utility functions More...

#include <iso_base_tools.h>

Collaboration diagram for iso::base::Tools:

Collaboration graph
[legend]
List of all members.

Public Member Functions

template<class Type>
void buffer2Type (const char *pBuffer, Type &pValue)
 convert byte buffer into int
template<class Type>
void buffer2TypeLE (const char *pBuffer, Type &pValue)
 convert byte buffer into int (little endian version)
template<class Type>
void buffer2TypeBE (const char *pBuffer, Type &pValue)
 convert byte buffer into int (big endian version)
template<class Type>
void type2Buffer (const Type &pValue, char *pBuffer)
 convert type into buffer
template<class Type>
void type2BufferLE (const Type &pValue, char *pBuffer)
 convert type into buffer (iittle endian version)
template<class Type>
void type2BufferBE (const Type &pValue, char *pBuffer)
 convert type into buffer (big endian version)
template<class Type>
void type2Buffer (const Type *pValues, unsigned int pValueCount, char *pBuffer)
 convert type array into buffer
template<class Type>
void type2BufferLE (const Type *pValues, unsigned int pValueCount, char *pBuffer)
 convert type array into buffer (little endian version)
template<class Type>
void type2BufferBE (const Type *pValues, unsigned int pValueCount, char *pBuffer)
 convert type array into buffer (big endian version)
void buffer2Buffer (const char *pSource, unsigned int pValueSize, unsigned int pValueCount, char *pTarget)
 convert buffer into buffer
void buffer2Buffer (char *pSource, char *pTarget, unsigned int pArraySize)
 copy byte buffer into byte buffer
void byteswap (char *pSource, char *pTarget, unsigned int pArraySize)
 byteswap from source byte array to target byte array
float byteswap (float pValue)
 byteswap for float values
double byteswap (double pValue)
 byteswap for double values
int64 time ()
 return absolute time (in micro secs)
double milisecs ()
 return absolute time (in mili secs)
int64 absTime ()
 return absolute time (in micro secs)
int64 relTime ()
 return relative time since the first instantiation of this class (in micro secs)

Static Public Member Functions

static Toolsget ()
 get singleton instance
static void destroy ()
 destroy singleton instance

Protected Member Functions

 Tools ()
 default constructor
 ~Tools ()
 destructor

Protected Attributes

Time mStartTime
 start time
Time mCurrentTime
 current time
TimeZone mTimeZone
 time zone

Static Protected Attributes

static ToolssTools
 singleton instance

Detailed Description

singleton class providing a basic set basic utility functions

providing a basic set basic utility functions

Created by Daniel Bisig on 7/22/07.


Constructor & Destructor Documentation

Tools::Tools (  )  [protected]

default constructor

Tools::~Tools (  )  [protected]

destructor


Member Function Documentation

Tools & Tools::get (  )  [static]

get singleton instance

Returns:
singleton instance

void Tools::destroy (  )  [static]

destroy singleton instance

template<class Type>
void iso::base::Tools::buffer2Type ( const char *  pBuffer,
Type &  pValue 
)

convert byte buffer into int

Parameters:
pBuffer byte buffer
Returns:
int

template<class Type>
void iso::base::Tools::buffer2TypeLE ( const char *  pBuffer,
Type &  pValue 
)

convert byte buffer into int (little endian version)

Parameters:
pBuffer byte buffer
Returns:
int

template<class Type>
void iso::base::Tools::buffer2TypeBE ( const char *  pBuffer,
Type &  pValue 
)

convert byte buffer into int (big endian version)

Parameters:
pBuffer byte buffer
Returns:
int

template<class Type>
void iso::base::Tools::type2Buffer ( const Type &  pValue,
char *  pBuffer 
)

convert type into buffer

Parameters:
pValue type value
pBuffer target buffer
Remarks:
beforms byte swap if necessary

template<class Type>
void iso::base::Tools::type2BufferLE ( const Type &  pValue,
char *  pBuffer 
)

convert type into buffer (iittle endian version)

Parameters:
pValue type value
pBuffer target buffer
Remarks:
beforms byte swap if necessary

template<class Type>
void iso::base::Tools::type2BufferBE ( const Type &  pValue,
char *  pBuffer 
)

convert type into buffer (big endian version)

Parameters:
pValue type value
pBuffer target buffer
Remarks:
beforms byte swap if necessary

template<class Type>
void iso::base::Tools::type2Buffer ( const Type *  pValues,
unsigned int  pValueCount,
char *  pBuffer 
)

convert type array into buffer

Parameters:
pValues type array
pValueCount number of type values
pBuffer target buffer
Remarks:
beforms byte swap if necessary

template<class Type>
void iso::base::Tools::type2BufferLE ( const Type *  pValues,
unsigned int  pValueCount,
char *  pBuffer 
)

convert type array into buffer (little endian version)

Parameters:
pValues type array
pValueCount number of type values
pBuffer target buffer
Remarks:
beforms byte swap if necessary

template<class Type>
void iso::base::Tools::type2BufferBE ( const Type *  pValues,
unsigned int  pValueCount,
char *  pBuffer 
)

convert type array into buffer (big endian version)

Parameters:
pValues type array
pValueCount number of type values
pBuffer target buffer
Remarks:
beforms byte swap if necessary

void Tools::buffer2Buffer ( const char *  pSource,
unsigned int  pValueSize,
unsigned int  pValueCount,
char *  pTarget 
)

convert buffer into buffer

Parameters:
pSource source buffer
pValueSize size of value type stored in source buffer
pValueCount number of values stored in source buffer
pTarget target buffer
Remarks:
beforms byte swap if necessary

void Tools::buffer2Buffer ( char *  pSource,
char *  pTarget,
unsigned int  pArraySize 
)

copy byte buffer into byte buffer

Parameters:
pSource source byte array
pTarget target byte array
pArraySize size of array
Remarks:
performs byte swap if necessary

void Tools::byteswap ( char *  pSource,
char *  pTarget,
unsigned int  pArraySize 
)

byteswap from source byte array to target byte array

Parameters:
pSource source byte array
pTarget target byte array
pArraySize size of array
convert from big endian to little endian and vice versa

float Tools::byteswap ( float  pValue  ) 

byteswap for float values

Parameters:
pValue input value
Returns:
byteswapped value
convert from big endian to little endian and vice versa

double Tools::byteswap ( double  pValue  ) 

byteswap for double values

Parameters:
pValue input value
Returns:
byteswapped value
convert from big endian to little endian and vice versa

int64 Tools::time (  ) 

return absolute time (in micro secs)

Returns:
absolute time (in micro secs)

double Tools::milisecs (  ) 

return absolute time (in mili secs)

Returns:
absolute time (in mili secs)

int64 Tools::absTime (  ) 

return absolute time (in micro secs)

Returns:
absolute time (in micro secs)

int64 Tools::relTime (  ) 

return relative time since the first instantiation of this class (in micro secs)

Returns:
relative time since the first instantiation of this class (in micro secs)


Member Data Documentation

Tools * Tools::sTools [static, protected]

singleton instance

Time iso::base::Tools::mStartTime [protected]

start time

Time iso::base::Tools::mCurrentTime [protected]

current time

TimeZone iso::base::Tools::mTimeZone [protected]

time zone


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 13:50:00 2011 for iso_base by  doxygen 1.5.1