lmsg::Grinder Class Reference
[DMT message facility]

#include <Grinder.hh>

List of all members.

Public Member Functions

 Grinder (void)
 Constructor.
 ~Grinder (void)
 Destructor.
bool need_swap (void) const
 Test if swapping is needed.
template<typename T>
void SwapT (T *_data)
 Swap data bytes in memory.
template<typename T>
void SwapIn (const char *_in, T *_out, size_type N)
 Swap data bytes in memory.
template<typename T>
void SwapOut (const T *_in, char *out, size_type N)
 Swap data bytes in memory.


Detailed Description

The Grinder class is used for machine-dependent conversion to the standard exchange format (e.g. byte-swapping). brief Conversion to exchange format.
Author:
J. Zweizig
Version:
2.0; Last modified may 18, 2007

Constructor & Destructor Documentation

lmsg::Grinder::Grinder ( void   ) 

Constructor.

Construct a grinder for use in converting to and from the host data format.

lmsg::Grinder::~Grinder ( void   ) 

Destructor.

Destry a grinder.


Member Function Documentation

bool lmsg::Grinder::need_swap ( void   )  const [inline]

Test if swapping is needed.

Test whether the data byte ordering needs to be swapped.

Returns:
True if swapping is needed.

template<typename T>
void lmsg::Grinder::SwapT ( T *  _data  )  [inline]

Swap data bytes in memory.

Swap byte ordering in place in memory of the specified data element.

Parameters:
_data Data storage address

template<typename T>
void lmsg::Grinder::SwapIn ( const char *  _in,
T *  _out,
size_type  N 
) [inline]

Swap data bytes in memory.

Swap byte ordering of N data words in the _in array, storing the result in the _out array. If the byte ordering of the current host is the same as the standard byte ordering, this is equivalent to a copy.

Parameters:
_in Pointer to data stored with standard byte ordering.
_out Data array to receive data with host ordering.
N Number of data words to copy and swap.

template<typename T>
void lmsg::Grinder::SwapOut ( const T *  _in,
char *  out,
size_type  N 
) [inline]

Swap data bytes in memory.

Swap byte ordering of N data words in the _data array, storing the result in the out array. If the byte ordering of the current host is the same as the standard byte ordering, this is equivalent to a copy.

Parameters:
_in Pointer to data stored with the host's byte ordering.
out Data array to receive data in stabdard byte order.
N Number of data words to copy and swap.


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:33 2009 for dmt by  doxygen 1.5.4