TBTK
TBTK::IndexedDataTree< Data, true > Class Template Reference
Inheritance diagram for TBTK::IndexedDataTree< Data, true >:
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
 

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

◆ IndexedDataTree() [1/2]

template<typename Data >
TBTK::IndexedDataTree< Data, true >::IndexedDataTree ( )

Constructor.

◆ IndexedDataTree() [2/2]

template<typename Data >
TBTK::IndexedDataTree< Data, true >::IndexedDataTree ( const std::string &  serialization,
Mode  mode 
)

Constructor. Constructs the IndexedDataTree from a serialization string.

◆ ~IndexedDataTree()

template<typename Data >
TBTK::IndexedDataTree< Data, true >::~IndexedDataTree ( )
virtual

Destructor.

Member Function Documentation

◆ add()

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

Add indexed data.

◆ begin() [1/2]

template<typename Data >
IndexedDataTree< Data, true >::Iterator TBTK::IndexedDataTree< Data, true >::begin ( )

Create Iterator.

Returns
Iterator pointing at the first element in the IndexedDataTree.

◆ begin() [2/2]

template<typename Data >
IndexedDataTree< Data, true >::ConstIterator TBTK::IndexedDataTree< Data, true >::begin ( ) const

Create Iterator.

Returns
Iterator pointing at the first element in the IndexedDataTree.

◆ cbegin()

template<typename Data >
IndexedDataTree< Data, true >::ConstIterator TBTK::IndexedDataTree< Data, true >::cbegin ( ) const

Create Iterator for constant elements.

Returns
Iterator pointing at the first element in the IndexedDataTree.

◆ cend()

template<typename Data >
IndexedDataTree< Data, true >::ConstIterator TBTK::IndexedDataTree< Data, true >::cend ( ) const

Get Iterator for constatne elements that points to the end.

Returns
An Iterator pointing at the end of the IndexedDataTree.

◆ clear()

template<typename Data >
void TBTK::IndexedDataTree< Data, true >::clear ( )

Clear.

◆ end() [1/2]

template<typename Data >
IndexedDataTree< Data, true >::Iterator TBTK::IndexedDataTree< Data, true >::end ( )

Get Iterator pointing to the end.

Returns
An Iterator pointing at the end of the IndexedDataTree.

◆ end() [2/2]

template<typename Data >
IndexedDataTree< Data, true >::ConstIterator TBTK::IndexedDataTree< Data, true >::end ( ) const

Get Iterator pointing to the end.

Returns
An Iterator pointing at the end of the IndexedDataTree.

◆ get() [1/3]

template<typename Data >
bool TBTK::IndexedDataTree< Data, true >::get ( Data &  data,
const Index index 
) const

Get data.

◆ get() [2/3]

template<typename Data >
Data & TBTK::IndexedDataTree< Data, true >::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.

◆ get() [3/3]

template<typename Data >
const Data & TBTK::IndexedDataTree< Data, true >::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.

◆ getSizeInBytes()

template<typename Data >
unsigned int TBTK::IndexedDataTree< Data, true >::getSizeInBytes ( ) const

Get size in bytes.

◆ serialize()

template<typename Data >
std::string TBTK::IndexedDataTree< Data, true >::serialize ( Mode  mode) const
virtual

Serilaize.

Implements TBTK::Serializable.


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