Any class X that implements the following two functions:
Typical usage of this template class:
MyClass a = (...); Buffer buf = NetworkFormat< MyClass >::createNetworkFormat( a );
SmartPtr<MyClass> b = NetworkFormat< MyClass >::createObject( buf );
Static Public Member Functions | |
static Buffer | createNetworkFormat (const X &a) |
To get the portable binary representation of an object. | |
static SmartPtr< X > | createObject (const Buffer &buf, bool fileOrderIsLittleEndian=true) |
Get an object from its portable binary representation. | |
static SmartPtr< X > | createObject (const Buffer &buf, SmartPtr< X > a, bool fileOrderIsLittleEndian=true) |
Flesh out a partially initialized object. | |
Protected Member Functions | |
NetworkFormat () | |
We are making this private so that no one tries to instantiate this class. | |
NetworkFormat (const NetworkFormat &) | |
We are making this private so that no one tries to instantiate this class. | |
NetworkFormat & | operator= (const NetworkFormat &) |
We are making this private so that no one tries to instantiate this class. |
code::NetworkFormat< X >::NetworkFormat | ( | ) | [protected] |
We are making this private so that no one tries to instantiate this class.
code::NetworkFormat< X >::NetworkFormat | ( | const NetworkFormat< X > & | ) | [protected] |
We are making this private so that no one tries to instantiate this class.
static Buffer code::NetworkFormat< X >::createNetworkFormat | ( | const X & | a | ) | [inline, static] |
To get the portable binary representation of an object.
The | object whose portable representation is to be obtained. |
static SmartPtr<X> code::NetworkFormat< X >::createObject | ( | const Buffer & | buf, | |
SmartPtr< X > | a, | |||
bool | fileOrderIsLittleEndian = true | |||
) | [inline, static] |
Flesh out a partially initialized object.
Get an object from its portable binary representation in buf. An ErrorLog message is sent and a null pointer is returned on error.
buf | the buffer with the portable binary representation. | |
a | an already constructed object the rest of whose fields will be filled in (or changed) using the stream. |
static SmartPtr<X> code::NetworkFormat< X >::createObject | ( | const Buffer & | buf, | |
bool | fileOrderIsLittleEndian = true | |||
) | [inline, static] |
NetworkFormat& code::NetworkFormat< X >::operator= | ( | const NetworkFormat< X > & | ) | [protected] |
We are making this private so that no one tries to instantiate this class.