votca 2024-dev
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
votca::tools::DataCollection< T > Class Template Reference

This class handles a set of arrays which can be identified by name tags. More...

#include <datacollection.h>

Collaboration diagram for votca::tools::DataCollection< T >:
Collaboration graph
[legend]

Classes

class  array
 The array class, extends vector by a name tag. More...
 
class  selection
 class for array selection More...
 

Public Types

using iterator = typename std::vector< array * >::iterator
 
using const_iterator = typename std::vector< array * >::const_iterator
 

Public Member Functions

 DataCollection ()=default
 constructor
 
 ~DataCollection ()
 destructor
 
void clear ()
 clears the data collection
 
Index size () const
 
bool empty () const
 
arrayoperator[] (Index i)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
arrayCreateArray (std::string name)
 create a new array
 
std::vector< array * > & Data ()
 access the data container
 
const std::vector< array * > & Data () const
 
arrayArrayByName (std::string name)
 access an array by name
 
selectionselect (std::string strselection, selection *sel_append=nullptr)
 select a set of arrays
 

Private Attributes

std::vector< array * > data_
 
std::map< std::string, array * > array_by_name_
 

Detailed Description

template<typename T>
class votca::tools::DataCollection< T >

This class handles a set of arrays which can be identified by name tags.

This class is a Container of arrays. The arrays can be accessed by specifying a name or wildcard.

Definition at line 43 of file datacollection.h.

Member Typedef Documentation

◆ const_iterator

template<typename T >
using votca::tools::DataCollection< T >::const_iterator = typename std::vector<array *>::const_iterator

Definition at line 58 of file datacollection.h.

◆ iterator

template<typename T >
using votca::tools::DataCollection< T >::iterator = typename std::vector<array *>::iterator

Definition at line 57 of file datacollection.h.

Constructor & Destructor Documentation

◆ DataCollection()

template<typename T >
votca::tools::DataCollection< T >::DataCollection ( )
default

constructor

◆ ~DataCollection()

template<typename T >
votca::tools::DataCollection< T >::~DataCollection ( )
inline

destructor

Definition at line 97 of file datacollection.h.

Member Function Documentation

◆ ArrayByName()

template<typename T >
DataCollection< T >::array * votca::tools::DataCollection< T >::ArrayByName ( std::string  name)

access an array by name

Definition at line 169 of file datacollection.h.

◆ begin() [1/2]

template<typename T >
iterator votca::tools::DataCollection< T >::begin ( )
inline

Definition at line 112 of file datacollection.h.

◆ begin() [2/2]

template<typename T >
const_iterator votca::tools::DataCollection< T >::begin ( ) const
inline

Definition at line 114 of file datacollection.h.

◆ clear()

template<typename T >
void votca::tools::DataCollection< T >::clear

clears the data collection

Definition at line 149 of file datacollection.h.

◆ CreateArray()

template<typename T >
DataCollection< T >::array * votca::tools::DataCollection< T >::CreateArray ( std::string  name)

create a new array

Definition at line 158 of file datacollection.h.

◆ Data() [1/2]

template<typename T >
std::vector< array * > & votca::tools::DataCollection< T >::Data ( )
inline

access the data container

Definition at line 125 of file datacollection.h.

◆ Data() [2/2]

template<typename T >
const std::vector< array * > & votca::tools::DataCollection< T >::Data ( ) const
inline

Definition at line 126 of file datacollection.h.

◆ empty()

template<typename T >
bool votca::tools::DataCollection< T >::empty ( ) const
inline

Definition at line 107 of file datacollection.h.

◆ end() [1/2]

template<typename T >
iterator votca::tools::DataCollection< T >::end ( )
inline

Definition at line 113 of file datacollection.h.

◆ end() [2/2]

template<typename T >
const_iterator votca::tools::DataCollection< T >::end ( ) const
inline

Definition at line 115 of file datacollection.h.

◆ operator[]()

template<typename T >
array & votca::tools::DataCollection< T >::operator[] ( Index  i)
inline

Definition at line 108 of file datacollection.h.

◆ select()

template<typename T >
DataCollection< T >::selection * votca::tools::DataCollection< T >::select ( std::string  strselection,
selection sel_append = nullptr 
)

select a set of arrays

WARNING If attempting to append to an existing selection you must be careful if there exist more than one array with the same name the first array name that matches 'strselection' will be appended.

Definition at line 180 of file datacollection.h.

◆ size()

template<typename T >
Index votca::tools::DataCollection< T >::size ( ) const
inline

\ brief returns the number of arrays

Definition at line 106 of file datacollection.h.

Member Data Documentation

◆ array_by_name_

template<typename T >
std::map<std::string, array *> votca::tools::DataCollection< T >::array_by_name_
private

Definition at line 145 of file datacollection.h.

◆ data_

template<typename T >
std::vector<array *> votca::tools::DataCollection< T >::data_
private

Definition at line 143 of file datacollection.h.


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