#include <serializeserver.h>

Public Member Functions | |
| SerializeServer (const char *id) | |
| virtual | ~SerializeServer () |
| bool | SetDefaultFormat (const string &format) |
| const string & | GetDefaultFormat () |
| bool | RegisterSerializer (const string &class_name, const string &format) |
| bool | Serialize (Serialized *obj, const string &file_path) |
| Serialized * | Deserialize (const string &file_path, Serialized *obj=NULL) |
Private Member Functions | |
| long | Serialize (Serialized *obj, byte_t *&buffer, const char *format=NULL) |
| Serialized * | Deserialize (const byte_t *buffer, long buff_size, Serialized *obj=NULL, const char *format=NULL) |
| Serializer * | NewSerializer (const char *format=NULL) |
| bool | IsSerializer (const char *format=NULL) |
Private Attributes | |
| string | default_format |
| Name of default format. | |
| string | default_serializer |
| Class name of default serializer used when format is not specified. | |
| hash_map< string, string > | serializers_map |
| Hash map of all registered serializers. | |
| SerializeServer::SerializeServer | ( | const char * | id | ) |
Constructor.
| SerializeServer::~SerializeServer | ( | ) | [virtual] |
Destructor.
| bool SerializeServer::SetDefaultFormat | ( | const string & | format | ) |
Sets default format. The serializer of this format will be used when format is not set explicitly.
| format | Identifier of serialize format. |
True if serializer of specified format is found. | const string & SerializeServer::GetDefaultFormat | ( | ) | [inline] |
Returns defult format.
| bool SerializeServer::RegisterSerializer | ( | const string & | class_name, | |
| const string & | format | |||
| ) |
Registers serializer of given class. This serializer will be associated with specified format.
| class_name | Class name of serializer. | |
| format | Identifier of data format. |
True if successful. | bool SerializeServer::Serialize | ( | Serialized * | obj, | |
| const string & | file_path | |||
| ) |
| Serialized * SerializeServer::Deserialize | ( | const string & | file_path, | |
| Serialized * | obj = NULL | |||
| ) |
| long SerializeServer::Serialize | ( | Serialized * | obj, | |
| byte_t *& | buffer, | |||
| const char * | format = NULL | |||
| ) | [private] |
| Serialized * SerializeServer::Deserialize | ( | const byte_t * | buffer, | |
| long | buff_size, | |||
| Serialized * | obj = NULL, |
|||
| const char * | format = NULL | |||
| ) | [private] |
| Serializer * SerializeServer::NewSerializer | ( | const char * | format = NULL |
) | [private] |
Cerates new serializer of given class name. Each serializer is a NOH child of serialize server.
| format | Identifier of data format. |
| bool SerializeServer::IsSerializer | ( | const char * | format = NULL |
) | [private] |
string SerializeServer::default_format [private] |
Name of default format.
string SerializeServer::default_serializer [private] |
Class name of default serializer used when format is not specified.
hash_map<string, string> SerializeServer::serializers_map [private] |
Hash map of all registered serializers.
1.5.3