Public Types

storage< KeyType, DataType, ObjectType > Struct Template Reference

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

Detailed Description

template<typename KeyType, typename DataType, typename ObjectType>
struct viennadata::config::storage< KeyType, DataType, ObjectType >

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.

Template Parameters:
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

Member Typedef Documentation


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