![]() |
Pixel Dust Game Engine
v0.9.5
|
Public Member Functions | |
virtual void | serialize_8u (uint64 val)=0 |
Serialize an 8 byte (64 bit) value into a buffer. | |
void | serialize_8 (int64 val) |
virtual void | serialize_4u (uint32 val)=0 |
Serialize a 4 byte (32 bit) value into a buffer. | |
void | serialize_4 (int32 val) |
virtual void | serialize_3u (uint32 val)=0 |
Serialize a 3 byte (24 bit) value into a buffer. | |
virtual void | serialize_2u (uint16 val)=0 |
Serialize a 2 byte (16 bit) value into a buffer. | |
void | serialize_2 (int16 val) |
virtual void | serialize_1u (uint8 val)=0 |
Serialize an 1 byte (8 bit) value into a buffer. | |
void | serialize_1 (int8 val) |
void | serialize_f (float val) |
Serialize a floating point value into a buffer. | |
void | serialize_d (double val) |
Serialize a double precision floating point value into a buffer. | |
virtual void | serialize_bool (bool val)=0 |
Serialize a boolean (1 bit) value into a buffer. | |
virtual void | serialize_uint (uint32 num)=0 |
Serialize an unsigned integer value into a buffer. | |
virtual void | serialize_color (const Color &c)=0 |
Serialize a pdg::Color. | |
virtual void | serialize_offset (const Offset &o)=0 |
Serialize a pdg::Offset. | |
void | serialize_point (const Point &p) |
Serialize a pdg::Point. | |
void | serialize_vector (const Vector &v) |
Serialize a pdg::Vector. | |
virtual void | serialize_rect (const Rect &r)=0 |
Serialize a pdg::Rect. | |
virtual void | serialize_rotr (const RotatedRect &rr)=0 |
Serialize a pdg::RotatedRect. | |
virtual void | serialize_quad (const Quad &q)=0 |
Serialize a pdg::Quad. | |
virtual void | serialize_str (const char *str)=0 |
Serialize an string value into a buffer. | |
void | serialize_string (const std::string &str) |
Serialize a string value from a std::string. | |
virtual void | serialize_mem (const void *mem, uint32 memLen)=0 |
Serialize an arbitrary block of memory. | |
virtual void | serialize_obj (const ISerializable *obj)=0 |
Serialize a serializable object. | |
template<typename T > | |
void | serialize_ref (const T *obj) MAY_THROW(unknown_object) |
Serialize a reference to a non-serializable object. | |
uint32 | sizeof_8u (uint64 val) const |
uint32 | sizeof_8 (int64 val) const |
uint32 | sizeof_4u (uint32 val) const |
uint32 | sizeof_4 (int32 val) const |
uint32 | sizeof_3u (uint32 val) const |
uint32 | sizeof_2u (uint16 val) const |
uint32 | sizeof_2 (int16 val) const |
uint32 | sizeof_1u (uint8 val) const |
uint32 | sizeof_1 (int8 val) const |
virtual uint32 | sizeof_bool (bool val) const =0 |
How many bytes are used to serialize a particular boolean value. | |
virtual uint32 | sizeof_uint (uint32 num) const =0 |
How many bytes are used to serialize a particular unsigned integer value. | |
virtual uint32 | sizeof_color (const Color &c) const =0 |
How many bytes are used to serialize a particular pdg::Color value. | |
virtual uint32 | sizeof_offset (const Offset &o) const =0 |
How many bytes are used to serialize a particular pdg::Offset, Point or Vector value. | |
uint32 | sizeof_vector (const Vector &v) const |
uint32 | sizeof_point (const Point &p) const |
virtual uint32 | sizeof_rect (const Rect &r) const =0 |
How many bytes are used to serialize a particular pdg::Rect value. | |
virtual uint32 | sizeof_rotr (const RotatedRect &rr) const =0 |
How many bytes are used to serialize a particular pdg::RotatedRect value. | |
virtual uint32 | sizeof_quad (const Quad &q) const =0 |
How many bytes are used to serialize a particular pdg::Quad value. | |
virtual uint32 | sizeof_str (const char *str) const =0 |
How many bytes are used to serialize a particular string. | |
uint32 | sizeof_string (const std::string &str) const |
How many bytes are used to serialize a particular std::string. | |
virtual uint32 | sizeof_mem (const void *mem, uint32 memLen) const =0 |
How many bytes are used to serialize a particular block of memory. | |
virtual uint32 | sizeof_obj (const ISerializable *obj)=0 |
How many bytes are used to serialize a particular object, including tags and size data. | |
template<typename T > | |
uint32 | sizeof_ref (const T *obj) const MAY_THROW(unknown_object) |
ISerializer & | setSendTags (bool sendThem) |
Turn on or off the sync tags for this steam. | |
Static Public Attributes | |
static int | s_TraceDepth |
static bool | s_DebugMode |
Protected Member Functions | |
virtual char * | statusDump (int hiliteBytes=0)=0 |
virtual void | startMark ()=0 |
virtual int | bytesFromMark ()=0 |
virtual void | serialize_ptr (const void *ptr)=0 |
virtual uint32 | sizeof_ptr (const void *ptr) const =0 |
ISerializer () | |
Protected Attributes | |
bool | mSendTags |
An interface to represent serialization capabilities
|
inlineprotected |
|
protectedpure virtual |
Implemented in Serializer.
|
inline |
|
pure virtual |
Serialize an 1 byte (8 bit) value into a buffer.
internal pointer gets advanced by 1 byte
val | the 8 bit value to serialize |
Implemented in Serializer.
|
inline |
|
pure virtual |
Serialize a 2 byte (16 bit) value into a buffer.
internal pointer gets advanced by 2 bytes
val | the 16 bit value to serialize |
Implemented in Serializer.
|
pure virtual |
Serialize a 3 byte (24 bit) value into a buffer.
internal pointer gets advanced by 3 bytes
val | the 24 bit value to serialize |
Implemented in Serializer.
|
inline |
|
pure virtual |
Serialize a 4 byte (32 bit) value into a buffer.
internal pointer gets advanced by 4 bytes
val | the 32 bit value to serialize |
Implemented in Serializer.
|
inline |
|
pure virtual |
Serialize an 8 byte (64 bit) value into a buffer.
internal pointer gets advanced by 8 bytes
val | the 64 bit value to serialize |
Implemented in Serializer.
|
pure virtual |
Serialize a boolean (1 bit) value into a buffer.
internal pointer gets advanced by 1 or 0 bytes, depending on the bytes needed to store the value
val | the boolean to serialize This is optimized for series of boolean values, so that between 1 and 8 bools serialized sequentially only use a single byte |
Implemented in Serializer.
|
pure virtual |
Serialize a pdg::Color.
internal pointer gets advanced by total size of serialized color
c | the Color to serialize |
Implemented in Serializer.
|
inline |
Serialize a double precision floating point value into a buffer.
internal pointer gets advanced by 8 bytes
val | the floating point value to serialize |
|
inline |
Serialize a floating point value into a buffer.
internal pointer gets advanced by 4 bytes
val | the floating point value to serialize |
|
pure virtual |
Serialize an arbitrary block of memory.
internal pointer gets advanced by serialized size of the memory block
val | the 8 bit value to serialize |
Implemented in Serializer.
|
pure virtual |
Serialize a serializable object.
internal pointer gets advanced by total size of serialized obj
obj | the object to serialize This works by writing the object's unique tag, then serializing the size of the object via obj->getSerializedSize() and then finally calling obj->serialize() to actually serialize the object's data |
Implemented in Serializer.
|
pure virtual |
Serialize a pdg::Offset.
internal pointer gets advanced by total size of serialized Offset
o | the Offset to serialize |
Implemented in Serializer.
|
inline |
Serialize a pdg::Point.
internal pointer gets advanced by total size of serialized Point
p | the Point to serialize |
|
protectedpure virtual |
Implemented in Serializer.
|
pure virtual |
Serialize a pdg::Quad.
internal pointer gets advanced by total size of serialized quad
q | the Quad to serialize |
Implemented in Serializer.
|
pure virtual |
Serialize a pdg::Rect.
internal pointer gets advanced by total size of serialized rect
r | the Rect to serialize |
Implemented in Serializer.
void serialize_ref | ( | const T * | obj | ) |
Serialize a reference to a non-serializable object.
|
pure virtual |
Serialize a pdg::RotatedRect.
internal pointer gets advanced by total size of serialized rect
r | the Rect to serialize |
Implemented in Serializer.
|
pure virtual |
Serialize an string value into a buffer.
internal pointer gets advanced by serialized size of string
val | the 8 bit value to serialize |
Implemented in Serializer.
|
inline |
Serialize a string value from a std::string.
internal pointer gets advanced by serialized size of string
str,a | std::string to be serialized |
|
pure virtual |
Serialize an unsigned integer value into a buffer.
internal pointer gets advanced by 1, 3, 5 bytes, depending on the bytes needed to store the value
num | the unsigned value to serialize |
Implemented in Serializer.
|
inline |
Serialize a pdg::Vector.
internal pointer gets advanced by total size of serialized Vector
p | the Vector to serialize |
|
inline |
Turn on or off the sync tags for this steam.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
pure virtual |
How many bytes are used to serialize a particular boolean value.
Implemented in Serializer.
|
pure virtual |
How many bytes are used to serialize a particular pdg::Color value.
Implemented in Serializer.
|
pure virtual |
How many bytes are used to serialize a particular block of memory.
Implemented in Serializer.
|
pure virtual |
How many bytes are used to serialize a particular object, including tags and size data.
Since objects are only serialized once, it is critical that you call this on objects in the same order you actually serialize those object. The first call for a particular object will return the number of bytes for the serialized object stream plus tag overhead. Successive calls will return the number of bytes used to store a reference to the object, usually a much smaller number. A NULL object pointer will always take a constant number of bytes needed for the null object tag
Implemented in Serializer.
|
pure virtual |
How many bytes are used to serialize a particular pdg::Offset, Point or Vector value.
Implemented in Serializer.
|
inline |
|
protectedpure virtual |
Implemented in Serializer.
|
pure virtual |
How many bytes are used to serialize a particular pdg::Quad value.
Implemented in Serializer.
|
pure virtual |
How many bytes are used to serialize a particular pdg::Rect value.
Implemented in Serializer.
uint32 sizeof_ref | ( | const T * | obj | ) | const |
|
pure virtual |
How many bytes are used to serialize a particular pdg::RotatedRect value.
Implemented in Serializer.
|
pure virtual |
How many bytes are used to serialize a particular string.
Implemented in Serializer.
|
inline |
How many bytes are used to serialize a particular std::string.
|
pure virtual |
How many bytes are used to serialize a particular unsigned integer value.
Implemented in Serializer.
|
inline |
|
protectedpure virtual |
Implemented in Serializer.
|
protectedpure virtual |
Implemented in Serializer.
|
protected |
|
static |
|
static |