Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Serialization.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ISerializable
 An interface for serializable objects. More...
 

Macros

#define Serialize_int_1(_pos, _val)    STMT( *((_pos)++) = (u8)((_val)&0xff); )
 
#define Serialize_int_2(_pos, _val)
 
#define Serialize_int_3(_pos, _val)
 
#define Serialize_int_4(_pos, _val)
 
#define Serialize_int_8(_pos, _val)
 
#define __shift_de(_pos, _val)
 
#define Deserialize_int_1(_pos, _val)
 
#define Deserialize_int_2(_pos, _val)
 
#define Deserialize_int_3(_pos, _val)
 
#define Deserialize_int_4(_pos, _val)
 
#define Deserialize_int_8(_pos, _val)
 

Macro Definition Documentation

◆ __shift_de

#define __shift_de (   _pos,
  _val 
)
Value:
STMT( \
(_val) <<= 8; \
(_val) += *((_pos)++); )
#define STMT(STMT_code__)
package code into a single statement.
Definition: code_generation.h:41

◆ Deserialize_int_1

#define Deserialize_int_1 (   _pos,
  _val 
)
Value:
STMT(\
(_val) = *((_pos)++); )

◆ Deserialize_int_2

#define Deserialize_int_2 (   _pos,
  _val 
)
Value:
STMT(\
Deserialize_int_1(_pos, _val); \
__shift_de(_pos, _val); )
#define Deserialize_int_1(_pos, _val)
Definition: Serialization.h:48

◆ Deserialize_int_3

#define Deserialize_int_3 (   _pos,
  _val 
)
Value:
STMT(\
Deserialize_int_2(_pos, _val); \
__shift_de(_pos, _val); )
#define Deserialize_int_2(_pos, _val)
Definition: Serialization.h:51

◆ Deserialize_int_4

#define Deserialize_int_4 (   _pos,
  _val 
)
Value:
STMT(\
Deserialize_int_3(_pos, _val); \
__shift_de(_pos, _val); )
#define Deserialize_int_3(_pos, _val)
Definition: Serialization.h:55

◆ Deserialize_int_8

#define Deserialize_int_8 (   _pos,
  _val 
)
Value:
STMT(\
uint32 _v1; uint32 _v2; \
Deserialize_int_4(_pos, _v1); \
Deserialize_int_4(_pos, _v2); \
_val = _v1; \
_val <<= 32; /* janwas: careful! (uint32 << 32) = 0 */ \
_val |= _v2; )

◆ Serialize_int_1

#define Serialize_int_1 (   _pos,
  _val 
)     STMT( *((_pos)++) = (u8)((_val)&0xff); )

◆ Serialize_int_2

#define Serialize_int_2 (   _pos,
  _val 
)
Value:
STMT(\
Serialize_int_1(_pos, (_val)>>8); \
Serialize_int_1(_pos, (_val)); \
)
#define Serialize_int_1(_pos, _val)
Definition: Serialization.h:21

◆ Serialize_int_3

#define Serialize_int_3 (   _pos,
  _val 
)
Value:
STMT(\
Serialize_int_1(_pos, (_val)>>16); \
Serialize_int_2(_pos, (_val)); \
)

◆ Serialize_int_4

#define Serialize_int_4 (   _pos,
  _val 
)
Value:
STMT(\
Serialize_int_1(_pos, (_val)>>24); \
Serialize_int_3(_pos, (_val)); \
)

◆ Serialize_int_8

#define Serialize_int_8 (   _pos,
  _val 
)
Value:
STMT(\
Serialize_int_4(_pos, (_val)>>32); \
Serialize_int_4(_pos, (_val)); \
)
#define Serialize_int_4(_pos, _val)
Definition: Serialization.h:34