nidas v1.2.3
|
EndianConverter that doesn't flip bytes. More...
#include <EndianConverter.h>
Public Types | |
enum | endianness { EC_UNKNOWN_ENDIAN , EC_BIG_ENDIAN , EC_LITTLE_ENDIAN } |
Public Member Functions | |
virtual | ~NoFlipConverter () |
double | doubleValue (const void *p) const |
Get 8 byte double at address, do endian conversion. | |
double | doubleValue (const double &p) const |
float | floatValue (const void *p) const |
Get 4 byte float at address, do endian conversion. | |
float | floatValue (const float &p) const |
int64_t | int64Value (const void *p) const |
Get 8 byte int64_t at address, do endian conversion. | |
int64_t | int64Value (const int64_t &p) const |
int32_t | int32Value (const void *p) const |
Get 4 byte int32 at address, do endian conversion. | |
int32_t | int32Value (const int32_t &p) const |
uint32_t | uint32Value (const void *p) const |
Get 4 byte unsigned int32_t at address, do endian conversion. | |
uint32_t | uint32Value (const uint32_t &p) const |
int16_t | int16Value (const void *p) const |
int16_t | int16Value (const int16_t &p) const |
uint16_t | uint16Value (const void *p) const |
uint16_t | uint16Value (const uint16_t &p) const |
void | doubleCopy (const double &v, void *p) const |
Copy 8 byte double to the given address, doing endian conversion. | |
void | floatCopy (const float &v, void *p) const |
Copy 4 byte float to the given address, doing endian conversion. | |
void | int64Copy (const int64_t &v, void *p) const |
Copy 8 byte int64_t to the given address, doing endian conversion. | |
void | int32Copy (const int &v, void *p) const |
void | uint32Copy (const uint32_t &v, void *p) const |
Copy 4 byte unsigned int to the given address, doing endian conversion. | |
void | int16Copy (const int16_t &v, void *p) const |
void | uint16Copy (const uint16_t &v, void *p) const |
virtual void | int32Copy (const int32_t &, void *) const =0 |
Copy 4 byte int to the given address, doing endian conversion. | |
Static Public Member Functions | |
static endianness | getHostEndianness () |
Return endianness value for this host. | |
static const EndianConverter * | getConverter (endianness input, endianness output) |
Return an EndianConverter for converting from one endian to another. | |
static const EndianConverter * | getConverter (endianness input) |
Return an EndianConverter for converting from an endian represenation to the endian representation of th host. | |
Static Public Attributes | |
static endianness | hostEndianness = EndianConverter::EC_UNKNOWN_ENDIAN |
Static Private Member Functions | |
static endianness | privGetHostEndianness () |
Static Private Attributes | |
static EndianConverter * | flipConverter = 0 |
static EndianConverter * | noflipConverter = 0 |
static Mutex | staticInitMutex = Mutex() |
EndianConverter that doesn't flip bytes.
|
inherited |
|
inlinevirtual |
|
inlinevirtual |
Copy 8 byte double to the given address, doing endian conversion.
Pointer to address does not need to be 8-byte aligned.
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Get 8 byte double at address, do endian conversion.
Pointer to address does not need to be 8-byte aligned.
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Copy 4 byte float to the given address, doing endian conversion.
Pointer to address does not need to be 4-byte aligned.
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Get 4 byte float at address, do endian conversion.
Pointer to address does not need to be 4-byte aligned.
Implements nidas::util::EndianConverter.
|
staticinherited |
Return an EndianConverter for converting from an endian represenation to the endian representation of th host.
If both are the same, then the converter that is returned just does memcpy's and does not change the representation. It is a const pointer since all its methods are const, and the pointer is owned by EndianConverter.
References nidas::util::EndianConverter::getConverter(), and nidas::util::EndianConverter::getHostEndianness().
|
staticinherited |
Return an EndianConverter for converting from one endian to another.
If both are the same, then the converter that is returned just does memcpy's and does not change the representation. It is a const pointer since all its methods are const, and the pointer is owned by EndianConverter.
References nidas::util::EndianConverter::flipConverter, nidas::util::EndianConverter::noflipConverter, and nidas::util::EndianConverter::staticInitMutex.
Referenced by nidas::util::EndianConverter::getConverter().
|
staticinherited |
Return endianness value for this host.
References nidas::util::EndianConverter::EC_UNKNOWN_ENDIAN, nidas::util::EndianConverter::hostEndianness, nidas::util::EndianConverter::privGetHostEndianness(), and nidas::util::EndianConverter::staticInitMutex.
Referenced by nidas::util::EndianConverter::getConverter().
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inline |
|
pure virtualinherited |
Copy 4 byte int to the given address, doing endian conversion.
Pointer to address does not need to be 4-byte aligned.
Implemented in nidas::util::FlipConverter.
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Get 4 byte int32 at address, do endian conversion.
Pointer to address does not need to be 4-byte aligned.
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Copy 8 byte int64_t to the given address, doing endian conversion.
Pointer to address does not need to be 8-byte aligned.
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Get 8 byte int64_t at address, do endian conversion.
Pointer to address does not need to be 8-byte aligned.
Implements nidas::util::EndianConverter.
|
staticprivateinherited |
References nidas::util::EndianConverter::EC_BIG_ENDIAN, nidas::util::EndianConverter::EC_LITTLE_ENDIAN, and VLOG.
Referenced by nidas::util::EndianConverter::getHostEndianness().
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Copy 4 byte unsigned int to the given address, doing endian conversion.
Pointer to address does not need to be 4-byte aligned.
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Implements nidas::util::EndianConverter.
|
inlinevirtual |
Get 4 byte unsigned int32_t at address, do endian conversion.
Pointer to address does not need to be 4-byte aligned.
Implements nidas::util::EndianConverter.
|
staticprivateinherited |
Referenced by nidas::util::EndianConverter::getConverter().
|
staticinherited |
Referenced by nidas::util::EndianConverter::getHostEndianness().
|
staticprivateinherited |
Referenced by nidas::util::EndianConverter::getConverter().