A traits class that specifies whether data should be stored in a dense (i.e. vector) or a sparse (i.e. map) manner. More...
#include <storage.hpp>
Public Types | |
typedef sparse_data_tag | tag |
A traits class that specifies whether data should be stored in a dense (i.e. vector) or a sparse (i.e. map) manner.
For dense storage it is required that ViennaData knows how to get ids from the elements (see element_identifier), otherwise it falls back to sparse storage. Add custom element identifier in your own code by overloading storage_traits appropriately. E.g. to store data of type double for class 'MyClass' in a dense manner, use
template < typename KeyType> struct storage_traits< KeyType, double, MyClass> { typedef dense_data_tag tag; };
Mind that this overload has to be placed in namespace viennadata.
KeyType | The type of the key used for access | |
DataType | Type of the data that is stored for the element | |
ObjectType | The type of the object the data is associated with |
typedef sparse_data_tag tag |