TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN > Class Template Reference
[Base Classes and Functions]

Class for holding byte ordered data types. More...

#include <TCValue.h>

Collaboration diagram for TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 operator T () const
 cast back to const basic type
const ucharGetBytes () const
ucharGetBytes ()
uint32 GetNumBytes () const
ByteOrderedValue< T,
IS_LITTLE_ENDIAN > & 
operator= (const T &a)
 assignment operator for setting values

Protected Member Functions

 ByteOrderedValue ()
 default constructor value is init with zero this means the template type must have an operator to init with 0
 ByteOrderedValue (const ByteOrderedValue< T, IS_LITTLE_ENDIAN > &val)
 copy constructor
 ByteOrderedValue (const T &val)
 constructor to init with specified value

Private Member Functions

void SwapBytes (T &val) const
 method which swaps bytes if needed

Private Attributes

m_val
 stores the value of


Detailed Description

template<class T, bool IS_LITTLE_ENDIAN>
class TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >

Class for holding byte ordered data types.

Definition at line 118 of file TCValue.h.


Constructor & Destructor Documentation

template<class T , bool IS_LITTLE_ENDIAN>
TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::ByteOrderedValue (  )  [inline, protected]

default constructor value is init with zero this means the template type must have an operator to init with 0

Definition at line 126 of file TCValue.h.

template<class T , bool IS_LITTLE_ENDIAN>
TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::ByteOrderedValue ( const ByteOrderedValue< T, IS_LITTLE_ENDIAN > &  val  )  [inline, protected]

copy constructor

Parameters:
val to copy

Definition at line 135 of file TCValue.h.

template<class T , bool IS_LITTLE_ENDIAN>
TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::ByteOrderedValue ( const T &  val  )  [inline, protected]

constructor to init with specified value

Parameters:
val value use for init

Definition at line 143 of file TCValue.h.


Member Function Documentation

template<class T , bool IS_LITTLE_ENDIAN>
TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::operator T (  )  const [inline]

cast back to const basic type

Definition at line 151 of file TCValue.h.

template<class T , bool IS_LITTLE_ENDIAN>
const uchar* TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::GetBytes (  )  const [inline]

Returns:
bytes in little endian const

Definition at line 159 of file TCValue.h.

template<class T , bool IS_LITTLE_ENDIAN>
uchar* TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::GetBytes (  )  [inline]

Returns:
bytes in little endian non const

Definition at line 161 of file TCValue.h.

template<class T , bool IS_LITTLE_ENDIAN>
uint32 TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::GetNumBytes (  )  const [inline]

Returns:
number of bytes of value

Definition at line 163 of file TCValue.h.

template<class T , bool IS_LITTLE_ENDIAN>
ByteOrderedValue<T, IS_LITTLE_ENDIAN>& TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::operator= ( const T &  a  )  [inline]

assignment operator for setting values

Definition at line 166 of file TCValue.h.

template<class T , bool IS_LITTLE_ENDIAN>
void TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::SwapBytes ( T &  val  )  const [inline, private]

method which swaps bytes if needed

Definition at line 175 of file TCValue.h.

Referenced by TC::ByteOrderedValue< T, false >::ByteOrderedValue(), TC::ByteOrderedValue< T, false >::operator T(), TC::ByteOrderedValue< T, false >::operator=(), and TC::ByteOrderedValue< T, false >::SwapBytes().

Here is the caller graph for this function:


Member Data Documentation

template<class T , bool IS_LITTLE_ENDIAN>
T TC::ByteOrderedValue< T, IS_LITTLE_ENDIAN >::m_val [private]


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

Copyright (c) Thomas Goessler 2003 - 2008