Changes between Version 7 and Version 8 of Documentation/Serialization
- Timestamp:
- Feb 8, 2010, 3:18:06 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/Serialization
v7 v8 74 74 }}} 75 75 Note the {{{T()}}} macro that is used for serialization of {{{std::string}}} objects. The following special handlers are provided: 76 * integer support - I( value, length ) 77 * const int support - cI( uintmax_t ) 76 * Integer support - I( variable, length ) 77 * (De-)Serializes the lower "length"-bits of the integer variable. Beware that serialization is done bitwise. Consider filling up a byte by using cI( 0, 8 - length % 8 ) to align preceding data to a byte-boundary! 78 79 * const int support - cI( uintmax_t, length ) 80 * Serializes a constant integer value with the given bit-length. 81 78 82 * const char* support - cT( const char* ) 79 * string and char* support - T( char* | std::string ) 83 * Serializes a zero-terminated c-style string 84 85 * string and char* support - T( char* | std::string [, length] ) 86 * (De-)Serializes a string. If no length is given, the string is serialized zero-terminated. If a length is given the length must be serialized and taken care of separately. 87 80 88 * pointer serialization - VO( pointer* ) 89 * (De-)Serializes virtual object. Note: The object is created with new. 81 90 82 91 It is always best to use types that have a specified length, e.g. {{{uint8_t}}}, {{{uint16_t}}}, ... etc. If you are serializing through a inherited type where the serialization is provided in the base class, use the {{{&}}} operator before. Such a case is e.g. the {{{NodeID}}} class: