matador::serializer Class Referenceabstract

A base class to serialize objects. More...

#include <serializer.hpp>

Public Member Functions

virtual void on_attribute (const char *id, char &x, const field_attributes &attr)=0
 Interface to serialize a char with given id.
 
virtual void on_attribute (const char *id, short &x, const field_attributes &attr)=0
 Interface to serialize a short with given id.
 
virtual void on_attribute (const char *id, int &x, const field_attributes &attr)=0
 Interface to serialize a int with given id.
 
virtual void on_attribute (const char *id, long &x, const field_attributes &attr)=0
 Interface to serialize a long with given id.
 
virtual void on_attribute (const char *id, long long &x, const field_attributes &attr)=0
 Interface to serialize a long long with given id.
 
virtual void on_attribute (const char *id, unsigned char &x, const field_attributes &attr)=0
 Interface to serialize a unsigned char with given id.
 
virtual void on_attribute (const char *id, unsigned short &x, const field_attributes &attr)=0
 Interface to serialize a unsigned short with given id.
 
virtual void on_attribute (const char *id, unsigned int &x, const field_attributes &attr)=0
 Interface to serialize a unsigned int with given id.
 
virtual void on_attribute (const char *id, unsigned long long &x, const field_attributes &attr)=0
 Interface to serialize a unsigned long long with given id.
 
virtual void on_attribute (const char *id, unsigned long &x, const field_attributes &attr)=0
 Interface to serialize a unsigned long with given id.
 
virtual void on_attribute (const char *id, bool &x, const field_attributes &attr)=0
 Interface to serialize a bool with given id.
 
virtual void on_attribute (const char *id, float &x, const field_attributes &attr)=0
 Interface to serialize a float with given id.
 
virtual void on_attribute (const char *id, double &x, const field_attributes &attr)=0
 Interface to serialize a double with given id.
 
virtual void on_attribute (const char *id, char *x, const field_attributes &attr)=0
 Interface to serialize a char string with given id.
 
virtual void on_attribute (const char *id, std::string &x, const field_attributes &attr)=0
 Interface to serialize a string with given id.
 
virtual void on_attribute (const char *id, matador::time &x, const field_attributes &attr)=0
 Interface to serialize a time with given id.
 
virtual void on_attribute (const char *id, matador::date &x, const field_attributes &attr)=0
 Interface to serialize a date with given id.
 
virtual void on_belongs_to (const char *id, matador::identifiable_holder &x, cascade_type cascade)=0
 Interface to serialize an object with given id and cascade type.
 
virtual void on_has_one (const char *id, matador::identifiable_holder &x, cascade_type cascade)=0
 Interface to serialize an object with given id and cascade type.
 
virtual void on_has_many (const char *, abstract_container &, const char *, const char *, cascade_type)=0
 Interface to serialize a relation with given id.
 
virtual void on_has_many (const char *, abstract_container &, cascade_type)=0
 Interface to serialize a relation with given id.
 

Detailed Description

A base class to serialize objects.

This class can be used as base class to create a concrete serializer class to serialize objects.

It is used if one need to pass a base class of a serializer instead a template.

Member Function Documentation

◆ on_attribute() [1/17]

virtual void matador::serializer::on_attribute ( const char *  id,
bool &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a bool with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [2/17]

virtual void matador::serializer::on_attribute ( const char *  id,
char &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a char with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [3/17]

virtual void matador::serializer::on_attribute ( const char *  id,
char *  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a char string with given id.

Parameters
idThe id of the value
xThe string value to be serialized
attrThe field attributes

◆ on_attribute() [4/17]

virtual void matador::serializer::on_attribute ( const char *  id,
double &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a double with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [5/17]

virtual void matador::serializer::on_attribute ( const char *  id,
float &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a float with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [6/17]

virtual void matador::serializer::on_attribute ( const char *  id,
int &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a int with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [7/17]

virtual void matador::serializer::on_attribute ( const char *  id,
long &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a long with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [8/17]

virtual void matador::serializer::on_attribute ( const char *  id,
long long &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a long long with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [9/17]

virtual void matador::serializer::on_attribute ( const char *  id,
matador::date x,
const field_attributes attr 
)
pure virtual

Interface to serialize a date with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [10/17]

virtual void matador::serializer::on_attribute ( const char *  id,
matador::time x,
const field_attributes attr 
)
pure virtual

Interface to serialize a time with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [11/17]

virtual void matador::serializer::on_attribute ( const char *  id,
short &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a short with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [12/17]

virtual void matador::serializer::on_attribute ( const char *  id,
std::string &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a string with given id.

Parameters
idThe id of the value
xThe string to be serialized
attrThe field attributes

◆ on_attribute() [13/17]

virtual void matador::serializer::on_attribute ( const char *  id,
unsigned char &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a unsigned char with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [14/17]

virtual void matador::serializer::on_attribute ( const char *  id,
unsigned int &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a unsigned int with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [15/17]

virtual void matador::serializer::on_attribute ( const char *  id,
unsigned long &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a unsigned long with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [16/17]

virtual void matador::serializer::on_attribute ( const char *  id,
unsigned long long &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a unsigned long long with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_attribute() [17/17]

virtual void matador::serializer::on_attribute ( const char *  id,
unsigned short &  x,
const field_attributes attr 
)
pure virtual

Interface to serialize a unsigned short with given id.

Parameters
idThe id of the value
xThe value to be serialized
attrThe field attributes

◆ on_belongs_to()

virtual void matador::serializer::on_belongs_to ( const char *  id,
matador::identifiable_holder x,
cascade_type  cascade 
)
pure virtual

Interface to serialize an object with given id and cascade type.

Parameters
idThe id of the value
xThe object to be serialized
cascadeThe cascade type

◆ on_has_many() [1/2]

void matador::serializer::on_has_many ( const char *  id,
abstract_container &  x,
cascade_type  cascade 
)
pure virtual

Interface to serialize a relation with given id.

Parameters
idThe id of the value
xThe value to be serialized
cascadeThe cascade type

◆ on_has_many() [2/2]

void matador::serializer::on_has_many ( const char *  id,
abstract_container &  x,
const char *  owner_id,
const char *  item_id,
cascade_type  cascade 
)
pure virtual

Interface to serialize a relation with given id.

Parameters
idThe id of the value
xThe value to be serialized
owner_idThe name of the owner field
item_idThe name of the item field
cascadeThe cascade type

◆ on_has_one()

virtual void matador::serializer::on_has_one ( const char *  id,
matador::identifiable_holder x,
cascade_type  cascade 
)
pure virtual

Interface to serialize an object with given id and cascade type.

Parameters
idThe id of the value
xThe object to be serialized
cascadeThe cascade type

The documentation for this class was generated from the following file:
  • matador/utils/serializer.hpp