VSM C++ SDK
Vehicle Specific Modules SDK
ugcs::vsm::Bo_value< T, Converter > Class Template Reference

Helper class for byte-order-dependent value representation. More...

#include <endian.h>

Public Member Functions

 Bo_value (T value=0)
 Construct value. More...
 
Bo_valueoperator= (T value)
 Assign new value. More...
 
 operator T () const
 Cast to underlying type. More...
 
Get () const
 Get the value of underlying type. More...
 

Static Public Member Functions

static T Get (const void *buffer)
 Interpret byte buffer as a storage for underlying type and return host byte order value. More...
 
static void Set (void *buffer, const T value)
 Save value given in host order to byte buffer. More...
 

Detailed Description

template<typename T, class Converter>
class ugcs::vsm::Bo_value< T, Converter >

Helper class for byte-order-dependent value representation.

Constructor & Destructor Documentation

template<typename T, class Converter>
ugcs::vsm::Bo_value< T, Converter >::Bo_value ( value = 0)
inline

Construct value.

Parameters
valueValue in host byte order.

Member Function Documentation

template<typename T, class Converter>
T ugcs::vsm::Bo_value< T, Converter >::Get ( ) const
inline

Get the value of underlying type.

Returns
Value in host byte order.
template<typename T, class Converter>
static T ugcs::vsm::Bo_value< T, Converter >::Get ( const void *  buffer)
inlinestatic

Interpret byte buffer as a storage for underlying type and return host byte order value.

Caller is responsible for the size of the input buffer.

Parameters
bufferInput buffer with original value.
Returns
Value in host byte order.
template<typename T, class Converter>
ugcs::vsm::Bo_value< T, Converter >::operator T ( ) const
inline

Cast to underlying type.

Returns
Value in host byte order.
template<typename T, class Converter>
Bo_value& ugcs::vsm::Bo_value< T, Converter >::operator= ( value)
inline

Assign new value.

Parameters
valueValue in host byte order.
template<typename T, class Converter>
static void ugcs::vsm::Bo_value< T, Converter >::Set ( void *  buffer,
const T  value 
)
inlinestatic

Save value given in host order to byte buffer.

Caller is responsible for the size of the buffer.

Parameters
bufferOutput buffer to save value to.
valuevalue in host byte order.

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