Public Types | Static Public Member Functions

container< KeyType, DataType, ObjectType, ObjectIdentificationTag, KeyDispatchTag, StorageTag > Struct Template Reference

The main container manipulation class. More...

#include <data_container.hpp>

Public Types

typedef container_storage
< KeyType, DataType,
ObjectType,
ObjectIdentificationTag,
KeyDispatchTag, StorageTag >
::container_type 
container_type
typedef data_type_reference
< DataType, container_type >
::type 
reference

Static Public Member Functions

static reference access (container_type &cont, ObjectType const &obj, KeyType const &key)
 Accesses the data associated with the supplied key for the provided object.
static reference access (container_type &cont, ObjectType const &obj)
 Accesses the data associated with the particular key type if type-based dispatch is used.
template<typename ContainerSrcType , typename ObjectSrcType >
static void copy (ContainerSrcType &cont_src, ObjectSrcType const &obj_src, container_type &cont_dest, ObjectType const &obj_dest)
 Copies all data of the particular key type (including degenerate case of type based dispatch, where only single data is moved).
static void reserve (container_type &cont, long num)
 Reserves memory for data using up to 'num' objects.
static void erase (container_type &cont, ObjectType const &obj, KeyType const &key)
 Erases data for a particular key.
static void erase (container_type &cont, ObjectType const &obj)
 Erases data for all keys of that type.
static DataType * find_impl (container_type &cont, ObjectType const &obj, KeyType const &key, type_key_dispatch_tag)
 Checks whether data for a particular object with a particular key is already stored. Implementation for type-based dispatch.
static DataType * find_impl (container_type &cont, ObjectType const &obj, KeyType const &key, full_key_dispatch_tag)
 Checks whether data for a particular object with a particular key is already stored. Implementation for full key dispatch.
static DataType * find (container_type &cont, ObjectType const &obj, KeyType const &key)
 Checks whether data for a particular object with a particular key is already stored.
static DataType * find (container_type &cont, ObjectType const &obj)
 Checks whether data for a particular object with a particular key is already stored. Key-type dispatch version.

Detailed Description

template<typename KeyType, typename DataType, typename ObjectType, typename ObjectIdentificationTag = typename viennadata::config::object_identifier<ObjectType>::tag, typename KeyDispatchTag = typename viennadata::config::key_dispatch<KeyType>::tag, typename StorageTag = typename viennadata::config::storage<KeyType, DataType, ObjectType>::tag>
struct viennadata::traits::container< KeyType, DataType, ObjectType, ObjectIdentificationTag, KeyDispatchTag, StorageTag >

The main container manipulation class.

Template Parameters:
KeyType Type of the key
DataType Type of the data
ObjectType Type of the object the data is stored for
ObjectIdentificationTag Identification mechanism (either by address or by ID)
KeyDispatchTag Dispatch by key object and type or only by type
StorageTag Store data either in a dense or in a sparse manner

Member Typedef Documentation

typedef container_storage<KeyType, DataType, ObjectType, ObjectIdentificationTag, KeyDispatchTag, StorageTag>::container_type container_type
typedef data_type_reference<DataType, container_type>::type reference

Member Function Documentation

static reference access ( container_type cont,
ObjectType const &  obj,
KeyType const &  key 
) [inline, static]

Accesses the data associated with the supplied key for the provided object.

static reference access ( container_type cont,
ObjectType const &  obj 
) [inline, static]

Accesses the data associated with the particular key type if type-based dispatch is used.

static void copy ( ContainerSrcType &  cont_src,
ObjectSrcType const &  obj_src,
container_type cont_dest,
ObjectType const &  obj_dest 
) [inline, static]

Copies all data of the particular key type (including degenerate case of type based dispatch, where only single data is moved).

static void erase ( container_type cont,
ObjectType const &  obj,
KeyType const &  key 
) [inline, static]

Erases data for a particular key.

static void erase ( container_type cont,
ObjectType const &  obj 
) [inline, static]

Erases data for all keys of that type.

static DataType* find ( container_type cont,
ObjectType const &  obj,
KeyType const &  key 
) [inline, static]

Checks whether data for a particular object with a particular key is already stored.

Returns:
Returns NULL if no data is found, otherwise returns a pointer to the data
static DataType* find ( container_type cont,
ObjectType const &  obj 
) [inline, static]

Checks whether data for a particular object with a particular key is already stored. Key-type dispatch version.

Returns:
Returns NULL if no data is found, otherwise returns a pointer to the data
static DataType* find_impl ( container_type cont,
ObjectType const &  obj,
KeyType const &  key,
full_key_dispatch_tag   
) [inline, static]

Checks whether data for a particular object with a particular key is already stored. Implementation for full key dispatch.

Returns:
Returns NULL if no data is found, otherwise returns a pointer to the data
static DataType* find_impl ( container_type cont,
ObjectType const &  obj,
KeyType const &  key,
type_key_dispatch_tag   
) [inline, static]

Checks whether data for a particular object with a particular key is already stored. Implementation for type-based dispatch.

Returns:
In this case, always a valid pointer to the underlying data is returned.
static void reserve ( container_type cont,
long  num 
) [inline, static]

Reserves memory for data using up to 'num' objects.


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