TBTK
TBTK::IndexedDataTree< Data, isSerializeable > Class Template Reference
Inheritance diagram for TBTK::IndexedDataTree< Data, isSerializeable >:
TBTK::Serializable

Classes

class  ConstIterator
 
class  Iterator
 

Public Member Functions

 IndexedDataTree ()
 
 IndexedDataTree (const std::string &serialization, Mode mode)
 
virtual ~IndexedDataTree ()
 
void add (const Data &data, const Index &index)
 
bool get (Data &data, const Index &index) const
 
Data & get (const Index &index)
 
const Data & get (const Index &index) const
 
void clear ()
 
unsigned int getSizeInBytes () const
 
virtual std::string serialize (Mode mode) const
 
Iterator begin ()
 
ConstIterator begin () const
 
ConstIterator cbegin () const
 
Iterator end ()
 
ConstIterator end () const
 
ConstIterator cend () const
 
template<>
 IndexedDataTree (const std::string &serialization, Mode mode)
 
template<>
 IndexedDataTree (const std::string &serialization, Mode mode)
 
template<>
 IndexedDataTree (const std::string &serialization, Mode mode)
 
template<>
 IndexedDataTree (const std::string &serialization, Mode mode)
 
template<>
 IndexedDataTree (const std::string &serialization, Mode mode)
 
template<>
 IndexedDataTree (const std::string &serialization, Mode mode)
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 

Additional Inherited Members

- Public Types inherited from TBTK::Serializable
enum  Mode { Debug, Binary, XML, JSON }
 
- Static Public Member Functions inherited from TBTK::Serializable
static bool hasID (const std::string &serialization, Mode mode)
 
static std::string getID (const std::string &serialization, Mode mode)
 
static std::string extractComponent (const std::string &serialization, const std::string &containerID, const std::string &componentID, const std::string &componentName, Mode mode)
 
- Static Protected Member Functions inherited from TBTK::Serializable
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)
 

Constructor & Destructor Documentation

template<typename Data , bool isSerializable>
TBTK::IndexedDataTree< Data, isSerializable >::IndexedDataTree ( )

Constructor.

template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
TBTK::IndexedDataTree< Data, isSerializeable >::IndexedDataTree ( const std::string &  serialization,
Mode  mode 
)

Constructor. Constructs the IndexedDataTree from a serialization string.

Parameters
serializationSerialization string from which to construct the IndexedDataTree.
modeMode with which the string has been serialized.
template<typename Data , bool isSerializable>
TBTK::IndexedDataTree< Data, isSerializable >::~IndexedDataTree ( )
virtual

Destructor.

Member Function Documentation

template<typename Data, bool isSerializable>
void TBTK::IndexedDataTree< Data, isSerializable >::add ( const Data &  data,
const Index index 
)

Add indexed data. Multiple calls to the function with the same Index will overwrite previous data.

Parameters
dataData element to add.
indexIndex at which to add the element.
template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
Iterator TBTK::IndexedDataTree< Data, isSerializeable >::begin ( )

Create Iterator.

Returns
Iterator pointing at the first element in the IndexedDataTree.
template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
ConstIterator TBTK::IndexedDataTree< Data, isSerializeable >::begin ( ) const

Create ConstIterator.

Returns
ConstIterator pointing at the first element in the IndexedDataTree.
template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
ConstIterator TBTK::IndexedDataTree< Data, isSerializeable >::cbegin ( ) const

Create ConstIterator.

Returns
ConstIterator pointing at the first element in the IndexedDataTree.
template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
ConstIterator TBTK::IndexedDataTree< Data, isSerializeable >::cend ( ) const

Get ConstIterator that points to the end.

Returns
A ConstIterator pointing at the end of the IndexedDataTree.
template<typename Data , bool isSerializable>
void TBTK::IndexedDataTree< Data, isSerializable >::clear ( )

Clear the data.

template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
Iterator TBTK::IndexedDataTree< Data, isSerializeable >::end ( )

Get Iterator pointing to the end.

Returns
An Iterator pointing at the end of the IndexedDataTree.
template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
ConstIterator TBTK::IndexedDataTree< Data, isSerializeable >::end ( ) const

Get ConstIterator pointing to the end.

Returns
A ConstIterator pointing at the end of the IndexedDataTree.
template<typename Data, bool isSerializable>
bool TBTK::IndexedDataTree< Data, isSerializable >::get ( Data &  data,
const Index index 
) const

Get data.

Parameters
dataReference to an object that the data will be written to.
indexIndex for which to extract the data for.
Returns
True if a data element was found, otherwise false.
template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
Data& TBTK::IndexedDataTree< Data, isSerializeable >::get ( const Index index)

Get data.

Parameters
indexIndex for which to extract the data for.
Returns
Reference to the element.
Exceptions
ElementNotFoundExceptionIf the no element with the requested Index exists.
template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
const Data& TBTK::IndexedDataTree< Data, isSerializeable >::get ( const Index index) const

Get data.

Parameters
indexIndex for which to extract the data for.
Returns
Reference to the element.
Exceptions
ElementNotFoundExceptionIf the no element with the requested Index exists.
template<typename Data , bool isSerializable>
unsigned int TBTK::IndexedDataTree< Data, isSerializable >::getSizeInBytes ( ) const

Get size in bytes.

Returns
Memory size required to store the IndexedDataTree.
template<typename Data, bool isSerializeable = std::is_base_of<Serializable, Data>::value>
virtual std::string TBTK::IndexedDataTree< Data, isSerializeable >::serialize ( Mode  mode) const
virtual

Serilaize.

Parameters
modeSerialization mode to use.
Returns
Serialized string representation of the IndexedDataTree.

Implements TBTK::Serializable.

template<>
std::string TBTK::IndexedDataTree< bool, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::IndexedDataTree< char, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::IndexedDataTree< int, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::IndexedDataTree< float, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::IndexedDataTree< double, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::IndexedDataTree< std::complex< double >, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.


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