#include <Grinder.hh>
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. | |
| 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.
| bool lmsg::Grinder::need_swap | ( | void | ) | const [inline] |
Test if swapping is needed.
Test whether the data byte ordering needs to be swapped.
| void lmsg::Grinder::SwapT | ( | T * | _data | ) | [inline] |
Swap data bytes in memory.
Swap byte ordering in place in memory of the specified data element.
| _data | Data storage address |
| 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.
| _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. |
| 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.
| _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. |
1.5.4