Nebula
Loading...
Searching...
No Matches
System::ByteOrder Class Reference

#include <byteorder.h>

Detailed Description

Provides information and methods to help with byte ordering issues.

The following byte orders are defined:

NOTE: on console-platforms it is strongly recommended to store binary data in console-byte-order during asset processing on the development PC, so that the console doesn't waste loading time with byte conversions!

Classes

union  PunDoubleULL
 
union  PunFloatUL
 

Public Types

enum  Type {
  LittleEndian = 0 , BigEndian , Network = BigEndian , Host = BigEndian ,
  LittleEndian = 0 , BigEndian , Network = BigEndian , Host = BigEndian
}
 
enum  Type {
  LittleEndian = 0 , BigEndian , Network = BigEndian , Host = BigEndian ,
  LittleEndian = 0 , BigEndian , Network = BigEndian , Host = BigEndian
}
 

Public Member Functions

 ByteOrder ()
 default constructor
 
 ByteOrder (Type fromByteOrder, Type toByteOrder)
 constructor: set byte order conversion rule
 
void SetFromByteOrder (Type fromByteOrder)
 set from-byte-order
 
Type GetFromByteOrder () const
 get from-byte-order
 
void SetToByteOrder (Type toByteOrder)
 set to-byte-order
 
Type GetToByteOrder () const
 get to-byte-order
 
template<class TYPE >
void ConvertInPlace (TYPE &val) const
 endian-convert in place
 
template<class TYPE >
TYPE Convert (TYPE val) const
 endian-convert by copy
 
 ByteOrder ()
 default constructor
 
 ByteOrder (Type fromByteOrder, Type toByteOrder)
 constructor: set byte order conversion rule
 
void SetFromByteOrder (Type fromByteOrder)
 set from-byte-order
 
Type GetFromByteOrder () const
 get from-byte-order
 
void SetToByteOrder (Type toByteOrder)
 set to-byte-order
 
Type GetToByteOrder () const
 get to-byte-order
 
template<class TYPE >
void Convert (TYPE &val) const
 endian-convert in place
 
template<>
__forceinline void ConvertInPlace (Type fromByteOrder, Type toByteOrder, short &val)
 
template<>
__forceinline void ConvertInPlace (short &val) const
 
template<>
__forceinline short Convert (Type fromByteOrder, Type toByteOrder, short val)
 
template<>
__forceinline short Convert (short val) const
 
template<>
__forceinline void ConvertInPlace (Type fromByteOrder, Type toByteOrder, ushort &val)
 
template<>
__forceinline void ConvertInPlace (ushort &val) const
 
template<>
__forceinline ushort Convert (Type fromByteOrder, Type toByteOrder, ushort val)
 
template<>
__forceinline ushort Convert (ushort val) const
 
template<>
__forceinline void ConvertInPlace (Type fromByteOrder, Type toByteOrder, int &val)
 
template<>
__forceinline void ConvertInPlace (int &val) const
 
template<>
__forceinline int Convert (Type fromByteOrder, Type toByteOrder, int val)
 
template<>
__forceinline int Convert (int val) const
 
template<>
__forceinline void ConvertInPlace (Type fromByteOrder, Type toByteOrder, uint &val)
 
template<>
__forceinline void ConvertInPlace (uint &val) const
 
template<>
__forceinline uint Convert (Type fromByteOrder, Type toByteOrder, uint val)
 
template<>
__forceinline uint Convert (uint val) const
 
template<>
__forceinline void ConvertInPlace (Type fromByteOrder, Type toByteOrder, float &val)
 
template<>
__forceinline void ConvertInPlace (float &val) const
 
template<>
__forceinline float Convert (Type fromByteOrder, Type toByteOrder, float val)
 
template<>
__forceinline float Convert (float val) const
 
template<>
__forceinline void ConvertInPlace (Type fromByteOrder, Type toByteOrder, double &val)
 
template<>
__forceinline void ConvertInPlace (double &val) const
 
template<>
__forceinline double Convert (Type fromByteOrder, Type toByteOrder, double val)
 
template<>
__forceinline uint64_t Convert (Type fromByteOrder, Type toByteOrder, uint64_t val)
 
template<>
__forceinline int64_t Convert (Type fromByteOrder, Type toByteOrder, int64_t val)
 
template<>
__forceinline int64_t Convert (int64_t val) const
 
template<>
__forceinline uint64_t Convert (uint64_t val) const
 
template<>
__forceinline double Convert (double val) const
 
template<>
__forceinline void Convert (short &val) const
 
template<>
__forceinline void Convert (ushort &val) const
 
template<>
__forceinline void Convert (int &val) const
 
template<>
__forceinline void Convert (uint &val) const
 
template<>
__forceinline void Convert (float &val) const
 
template<>
__forceinline void Convert (double &val) const
 

Static Public Member Functions

template<class TYPE >
static void ConvertInPlace (Type fromByteOrder, Type toByteOrder, TYPE &val)
 endian-convert in place
 
template<class TYPE >
static TYPE Convert (Type fromByteOrder, Type toByteOrder, TYPE val)
 endian-convert by copy
 

Private Attributes

Type from
 
Type to
 

Member Enumeration Documentation

◆ Type [1/2]

Enumerator
LittleEndian 
BigEndian 
Network 
Host 
LittleEndian 
BigEndian 
Network 
Host 

◆ Type [2/2]

Enumerator
LittleEndian 
BigEndian 
Network 
Host 
LittleEndian 
BigEndian 
Network 
Host 

Constructor & Destructor Documentation

◆ ByteOrder() [1/4]

__forceinline System::ByteOrder::ByteOrder ( )

default constructor

◆ ByteOrder() [2/4]

__forceinline System::ByteOrder::ByteOrder ( ByteOrder::Type fromByteOrder,
ByteOrder::Type toByteOrder )

constructor: set byte order conversion rule

◆ ByteOrder() [3/4]

System::ByteOrder::ByteOrder ( )

default constructor

◆ ByteOrder() [4/4]

System::ByteOrder::ByteOrder ( Type fromByteOrder,
Type toByteOrder )

constructor: set byte order conversion rule

Member Function Documentation

◆ Convert() [1/25]

template<>
__forceinline void System::ByteOrder::Convert ( double & val) const

◆ Convert() [2/25]

template<>
__forceinline double System::ByteOrder::Convert ( double val) const

◆ Convert() [3/25]

template<>
__forceinline void System::ByteOrder::Convert ( float & val) const

◆ Convert() [4/25]

template<>
__forceinline float System::ByteOrder::Convert ( float val) const

◆ Convert() [5/25]

template<>
__forceinline void System::ByteOrder::Convert ( int & val) const

◆ Convert() [6/25]

template<>
__forceinline int System::ByteOrder::Convert ( int val) const

◆ Convert() [7/25]

template<>
__forceinline int64_t System::ByteOrder::Convert ( int64_t val) const

◆ Convert() [8/25]

template<>
__forceinline void System::ByteOrder::Convert ( short & val) const

◆ Convert() [9/25]

template<>
__forceinline short System::ByteOrder::Convert ( short val) const

◆ Convert() [10/25]

template<class TYPE >
void System::ByteOrder::Convert ( TYPE & val) const

endian-convert in place

◆ Convert() [11/25]

template<>
__forceinline double System::ByteOrder::Convert ( Type fromByteOrder,
Type toByteOrder,
double val )

◆ Convert() [12/25]

template<>
__forceinline float System::ByteOrder::Convert ( Type fromByteOrder,
Type toByteOrder,
float val )

◆ Convert() [13/25]

template<>
__forceinline int System::ByteOrder::Convert ( Type fromByteOrder,
Type toByteOrder,
int val )

◆ Convert() [14/25]

template<>
__forceinline int64_t System::ByteOrder::Convert ( Type fromByteOrder,
Type toByteOrder,
int64_t val )

◆ Convert() [15/25]

template<>
__forceinline short System::ByteOrder::Convert ( Type fromByteOrder,
Type toByteOrder,
short val )

◆ Convert() [16/25]

template<class TYPE >
static TYPE System::ByteOrder::Convert ( Type fromByteOrder,
Type toByteOrder,
TYPE val )
static

endian-convert by copy

◆ Convert() [17/25]

template<>
__forceinline uint System::ByteOrder::Convert ( Type fromByteOrder,
Type toByteOrder,
uint val )

◆ Convert() [18/25]

template<>
__forceinline uint64_t System::ByteOrder::Convert ( Type fromByteOrder,
Type toByteOrder,
uint64_t val )

◆ Convert() [19/25]

template<>
__forceinline ushort System::ByteOrder::Convert ( Type fromByteOrder,
Type toByteOrder,
ushort val )

◆ Convert() [20/25]

template<class TYPE >
TYPE System::ByteOrder::Convert ( TYPE val) const

endian-convert by copy

◆ Convert() [21/25]

template<>
__forceinline void System::ByteOrder::Convert ( uint & val) const

◆ Convert() [22/25]

template<>
__forceinline uint System::ByteOrder::Convert ( uint val) const

◆ Convert() [23/25]

template<>
__forceinline uint64_t System::ByteOrder::Convert ( uint64_t val) const

◆ Convert() [24/25]

template<>
__forceinline void System::ByteOrder::Convert ( ushort & val) const

◆ Convert() [25/25]

template<>
__forceinline ushort System::ByteOrder::Convert ( ushort val) const

◆ ConvertInPlace() [1/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( double & val) const

◆ ConvertInPlace() [2/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( float & val) const

◆ ConvertInPlace() [3/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( int & val) const

◆ ConvertInPlace() [4/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( short & val) const

◆ ConvertInPlace() [5/14]

template<class TYPE >
void System::ByteOrder::ConvertInPlace ( TYPE & val) const

endian-convert in place

◆ ConvertInPlace() [6/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( Type fromByteOrder,
Type toByteOrder,
double & val )

◆ ConvertInPlace() [7/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( Type fromByteOrder,
Type toByteOrder,
float & val )

◆ ConvertInPlace() [8/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( Type fromByteOrder,
Type toByteOrder,
int & val )

◆ ConvertInPlace() [9/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( Type fromByteOrder,
Type toByteOrder,
short & val )

◆ ConvertInPlace() [10/14]

template<class TYPE >
static void System::ByteOrder::ConvertInPlace ( Type fromByteOrder,
Type toByteOrder,
TYPE & val )
static

endian-convert in place

◆ ConvertInPlace() [11/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( Type fromByteOrder,
Type toByteOrder,
uint & val )

◆ ConvertInPlace() [12/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( Type fromByteOrder,
Type toByteOrder,
ushort & val )

◆ ConvertInPlace() [13/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( uint & val) const

◆ ConvertInPlace() [14/14]

template<>
__forceinline void System::ByteOrder::ConvertInPlace ( ushort & val) const

◆ GetFromByteOrder() [1/2]

__forceinline ByteOrder::Type System::ByteOrder::GetFromByteOrder ( ) const

get from-byte-order

◆ GetFromByteOrder() [2/2]

Type System::ByteOrder::GetFromByteOrder ( ) const

get from-byte-order

◆ GetToByteOrder() [1/2]

__forceinline ByteOrder::Type System::ByteOrder::GetToByteOrder ( ) const

get to-byte-order

◆ GetToByteOrder() [2/2]

Type System::ByteOrder::GetToByteOrder ( ) const

get to-byte-order

◆ SetFromByteOrder() [1/2]

__forceinline void System::ByteOrder::SetFromByteOrder ( Type fromByteOrder)

set from-byte-order

◆ SetFromByteOrder() [2/2]

void System::ByteOrder::SetFromByteOrder ( Type fromByteOrder)

set from-byte-order

◆ SetToByteOrder() [1/2]

__forceinline void System::ByteOrder::SetToByteOrder ( Type toByteOrder)

set to-byte-order

◆ SetToByteOrder() [2/2]

void System::ByteOrder::SetToByteOrder ( Type toByteOrder)

set to-byte-order

Member Data Documentation

◆ from

Type System::ByteOrder::from
private

◆ to

Type System::ByteOrder::to
private

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