TBTK
TBTK::Serializable Class Referenceabstract
Inheritance diagram for TBTK::Serializable:
TBTK::Property::AbstractProperty< double > TBTK::Property::AbstractProperty< SpinMatrix > TBTK::Property::AbstractProperty< std::complex< double > > TBTK::IndexedDataTree< SerializeableVector< std::complex< double > > > TBTK::IndexedDataTree< TBTK::SerializableVector< std::complex< double > > > TBTK::IndexedDataTree< TBTK::SourceAmplitude > TBTK::SerializableVector< std::complex< double > > TBTK::DataManager TBTK::Geometry TBTK::HoppingAmplitudeList TBTK::HoppingAmplitudeSet TBTK::HoppingAmplitudeTree TBTK::IndexDescriptor TBTK::IndexedDataTree< Data, bool > TBTK::IndexedDataTree< Data, false > TBTK::IndexedDataTree< Data, true > TBTK::IndexTree TBTK::Model TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable > TBTK::Range TBTK::SerializableVector< DataType, bool > TBTK::SerializableVector< DataType, false > TBTK::SerializableVector< DataType, true > TBTK::SingleParticleContext TBTK::SourceAmplitudeSet

Public Types

enum  Mode { Debug, Binary, XML, JSON }
 

Public Member Functions

virtual std::string serialize (Mode mode) const =0
 

Static Public Member Functions

static bool hasID (const std::string &serialization, Mode mode)
 
static std::string getID (const std::string &serialization, Mode mode)
 

Static Protected Member Functions

static bool validate (const std::string &serialization, const std::string &id, Mode mode)
 
static std::string getContent (const std::string &serialization, Mode mode)
 
static std::vector< std::string > split (const std::string &content, Mode mode)
 
static std::string serialize (bool b, Mode mode)
 
static void deserialize (const std::string &serialization, bool *b, Mode mode)
 
static std::string serialize (int i, Mode mode)
 
static void deserialize (const std::string &serialization, int *i, Mode mode)
 
static std::string serialize (unsigned int u, Mode mode)
 
static void deserialize (const std::string &serialization, unsigned int *u, Mode mode)
 
static std::string serialize (double d, Mode mode)
 
static void deserialize (const std::string &serialization, double *d, Mode mode)
 
static std::string serialize (std::complex< double > c, Mode mode)
 
static void deserialize (const std::string &serialization, std::complex< double > *c, Mode mode)
 
static std::string serialize (Statistics s, Mode mode)
 
static void deserialize (const std::string &serialization, Statistics *s, Mode mode)
 
static std::string extract (const std::string &serialization, Mode mode, std::string component)
 

Friends

class Index
 
class HoppingAmplitude
 
class SourceAmplitude
 

Member Enumeration Documentation

Serialization modes. Note that debug is not guaranteed to be backward compatible.

Member Function Documentation

void TBTK::Serializable::deserialize ( const std::string &  serialization,
bool *  b,
Mode  mode 
)
inlinestaticprotected

Deserialize bool.

void TBTK::Serializable::deserialize ( const std::string &  serialization,
int *  i,
Mode  mode 
)
inlinestaticprotected

Deserialize int.

void TBTK::Serializable::deserialize ( const std::string &  serialization,
unsigned int *  u,
Mode  mode 
)
inlinestaticprotected

Deserialize unsigned int.

void TBTK::Serializable::deserialize ( const std::string &  serialization,
double *  d,
Mode  mode 
)
inlinestaticprotected

Deserialize double.

void TBTK::Serializable::deserialize ( const std::string &  serialization,
std::complex< double > *  c,
Mode  mode 
)
inlinestaticprotected

Deserialize complex<double>.

void TBTK::Serializable::deserialize ( const std::string &  serialization,
Statistics s,
Mode  mode 
)
inlinestaticprotected

Deserialize Statistics.

static std::string TBTK::Serializable::extract ( const std::string &  serialization,
Mode  mode,
std::string  component 
)
staticprotected

Extracts a component of a serialization string, catching potential errors. In particular used to extract the serialization string for parents in the constructor of a child, because no try-catch block is possible to insert at this point.

static std::string TBTK::Serializable::getContent ( const std::string &  serialization,
Mode  mode 
)
staticprotected

Get the content of a serializtion string.

static std::string TBTK::Serializable::getID ( const std::string &  serialization,
Mode  mode 
)
static

Get the ID of a serialization string.

static bool TBTK::Serializable::hasID ( const std::string &  serialization,
Mode  mode 
)
static

Returns true if the serialization string has an ID.

virtual std::string TBTK::Serializable::serialize ( Mode  mode) const
pure virtual

Serialize object.

Implemented in TBTK::IndexedDataTree< Data, bool >, TBTK::IndexedDataTree< Data, bool >, TBTK::IndexedDataTree< Data, bool >, TBTK::IndexedDataTree< Data, bool >, TBTK::IndexedDataTree< Data, bool >, TBTK::IndexedDataTree< Data, bool >, TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >, TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >, TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >, TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >, TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >, TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >, TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >, TBTK::HoppingAmplitudeTree, TBTK::HoppingAmplitudeSet, TBTK::Model, TBTK::IndexedDataTree< Data, false >, TBTK::SourceAmplitudeSet, TBTK::Geometry, TBTK::IndexTree, TBTK::DataManager, TBTK::SingleParticleContext, TBTK::Property::WaveFunctions, TBTK::IndexedDataTree< Data, true >, TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >, TBTK::Property::SpinPolarizedLDOS, TBTK::Property::AbstractProperty< SpinMatrix >, TBTK::Property::AbstractProperty< double >, TBTK::Property::AbstractProperty< std::complex< double > >, TBTK::Property::LDOS, TBTK::IndexDescriptor, TBTK::SerializableVector< DataType, false >, TBTK::Property::SpectralFunction, TBTK::Property::Magnetization, TBTK::HoppingAmplitudeList, TBTK::Property::Density, TBTK::Property::DOS, TBTK::SerializableVector< DataType, true >, TBTK::IndexedDataTree< Data, bool >, TBTK::IndexedDataTree< SerializeableVector< std::complex< double > > >, TBTK::IndexedDataTree< TBTK::SourceAmplitude >, TBTK::IndexedDataTree< TBTK::SerializableVector< std::complex< double > > >, TBTK::Property::EigenValues, TBTK::Range, TBTK::SerializableVector< DataType, bool >, and TBTK::SerializableVector< std::complex< double > >.

std::string TBTK::Serializable::serialize ( bool  b,
Mode  mode 
)
inlinestaticprotected

Serialize bool.

std::string TBTK::Serializable::serialize ( int  i,
Mode  mode 
)
inlinestaticprotected

Serialize int.

std::string TBTK::Serializable::serialize ( unsigned int  u,
Mode  mode 
)
inlinestaticprotected

Serialize unsigned int.

std::string TBTK::Serializable::serialize ( double  d,
Mode  mode 
)
inlinestaticprotected

Serialize double.

std::string TBTK::Serializable::serialize ( std::complex< double >  c,
Mode  mode 
)
inlinestaticprotected

Serialize complex<double>.

std::string TBTK::Serializable::serialize ( Statistics  s,
Mode  mode 
)
inlinestaticprotected

Serialize Statistics.

static std::vector<std::string> TBTK::Serializable::split ( const std::string &  content,
Mode  mode 
)
staticprotected

Split content string.

static bool TBTK::Serializable::validate ( const std::string &  serialization,
const std::string &  id,
Mode  mode 
)
staticprotected

Validate serialization string.

Friends And Related Function Documentation

friend class Index
friend

Friend classes (Classes that are psudo-Serializable because they are so small and often used that a virtual function would have a non-negligible performance penalty).


The documentation for this class was generated from the following file: