This module contains all the functions needed by library users of ViennaData. More...
Functions | |
template<typename KeyType , typename DataType > | |
data_accessor_with_key < KeyType, DataType > | access (KeyType const &key) |
The main access function within ViennaData. Allows to access data stored with a particular key, using full dispatch (type and object). | |
template<typename KeyType , typename DataType > | |
data_accessor_no_key< KeyType, DataType > | access () |
The main access function within ViennaData. Allows to access data stored with a particular key, using type based dispatch. | |
template<typename KeyType , typename DataType > | |
data_erasor_with_key< KeyType, DataType > | erase (KeyType const &key) |
Erase data associated with key 'key'. The object is obtained via a proxy class. | |
template<typename KeyType , typename DataType > | |
data_erasor_no_key< KeyType, DataType > | erase () |
Erase all data associated with keys of 'KeyType'. | |
template<typename KeyType , typename DataType > | |
data_copy_with_key< KeyType, DataType > | copy (KeyType const &key) |
Copies data associated with key 'key' from one object to another. | |
template<typename KeyType , typename DataType > | |
data_copy_no_key< KeyType, DataType > | copy () |
Copies data associated with all keys of type 'KeyType' from one object to another. | |
template<typename KeyType , typename DataType > | |
data_mover_with_key< KeyType, DataType > | move (KeyType const &key) |
Moves data associated with key 'key' from one object to another. | |
template<typename KeyType , typename DataType > | |
data_mover_no_key< KeyType, DataType > | move () |
Moves data associated with all keys of type 'KeyType' from one object to another. | |
template<typename KeyType , typename DataType > | |
data_reservation_proxy < KeyType, DataType > | reserve (long num) |
Reserves memory for storing data associated with a particular key type. | |
template<typename KeyType , typename DataType > | |
data_find_proxy_with_key < KeyType, DataType > | find (KeyType const &key) |
Reserves memory for storing data associated with a particular key type. | |
template<typename KeyType , typename DataType > | |
data_find_proxy_no_key < KeyType, DataType > | find () |
Reserves memory for storing data associated with a particular key type (key type dispatch). |
This module contains all the functions needed by library users of ViennaData.
data_accessor_with_key<KeyType, DataType> viennadata::access | ( | KeyType const & | key | ) |
The main access function within ViennaData. Allows to access data stored with a particular key, using full dispatch (type and object).
Should be called in the form
viennadata:access<KeyType, DataType>(my_key)(my_obj) = some_value;
and
some_value = viennadata:access<KeyType, DataType>(my_key)(my_obj);
This would write and read data stored using a key 'my_key' of type 'KeyType' from 'my_obj'.
KeyType | Type of the key | |
DataType | Type of the data |
data_accessor_no_key<KeyType, DataType> viennadata::access | ( | ) |
The main access function within ViennaData. Allows to access data stored with a particular key, using type based dispatch.
Should be called in the form
viennadata:access<KeyType, DataType>()(my_obj) = some_value;
and
some_value = viennadata:access<KeyType, DataType>()(my_obj);
This would write and read data stored using a key of type 'KeyType' from 'my_obj'.
KeyType | Type of the key | |
DataType | Type of the data |
data_copy_with_key<KeyType, DataType> viennadata::copy | ( | KeyType const & | key | ) |
Copies data associated with key 'key' from one object to another.
Should be called in the form
viennadata:copy<KeyType, DataType>()(src_obj, dest_obj);
This would copy data stored using a key of type 'KeyType' from 'src_obj' to 'dest_obj'.
KeyType | Type of the key | |
DataType | Type of the data |
data_copy_no_key<KeyType, DataType> viennadata::copy | ( | ) |
Copies data associated with all keys of type 'KeyType' from one object to another.
Should be called in the form
viennadata:copy<KeyType, DataType>()(src_obj, dest_obj);
This would copy data stored using a key of type 'KeyType' from 'src_obj' to 'dest_obj'.
KeyType | Type of the key | |
DataType | Type of the data |
data_erasor_no_key<KeyType, DataType> viennadata::erase | ( | ) |
Erase all data associated with keys of 'KeyType'.
Should be called in the form
viennadata:erase<KeyType, DataType>()(my_obj);
This would erase data stored using a key of type 'KeyType' from 'my_obj'.
KeyType | Type of the key | |
DataType | Type of the data |
data_erasor_with_key<KeyType, DataType> viennadata::erase | ( | KeyType const & | key | ) |
Erase data associated with key 'key'. The object is obtained via a proxy class.
Should be called in the form
viennadata:erase<KeyType, DataType>(my_key)(my_obj);
This would erase data stored using a key 'my_key' of type 'KeyType' from 'my_obj'.
KeyType | Type of the key | |
DataType | Type of the data |
data_find_proxy_with_key<KeyType, DataType> viennadata::find | ( | KeyType const & | key | ) |
Reserves memory for storing data associated with a particular key type.
Should be called in the form
viennadata:find<KeyType, DataType>(my_key)(my_obj);
This would search for data associated with my_obj using a key of type 'KeyType'. If found, a pointer to the data is returned, otherwise NULL.
KeyType | Type of the key | |
DataType | Type of the data |
key | The key object |
data_find_proxy_no_key<KeyType, DataType> viennadata::find | ( | ) |
Reserves memory for storing data associated with a particular key type (key type dispatch).
Should be called in the form
viennadata:find<KeyType, DataType>()(my_obj);
This would search for data associated with my_obj using a key of type 'KeyType'. If found, a pointer to the data is returned, otherwise NULL.
KeyType | Type of the key | |
DataType | Type of the data |
data_mover_no_key<KeyType, DataType> viennadata::move | ( | ) |
Moves data associated with all keys of type 'KeyType' from one object to another.
Should be called in the form
viennadata:move<KeyType, DataType>()(src_obj, dest_obj);
This would move data stored using a key of type 'KeyType' from 'src_obj' to 'dest_obj'.
KeyType | Type of the key | |
DataType | Type of the data |
data_mover_with_key<KeyType, DataType> viennadata::move | ( | KeyType const & | key | ) |
Moves data associated with key 'key' from one object to another.
Should be called in the form
viennadata:move<KeyType, DataType>(key)(src_obj, dest_obj);
This would move data stored using a key 'key' of type 'KeyType' from 'src_obj' to 'dest_obj'.
KeyType | Type of the key | |
DataType | Type of the data |
data_reservation_proxy<KeyType, DataType> viennadata::reserve | ( | long | num | ) |
Reserves memory for storing data associated with a particular key type.
Should be called in the form
viennadata:reserve<KeyType, DataType>(num)(my_obj);
This would reserve memory for num objects with the same type as my_obj for data storage using a key of type 'KeyType'. Object IDs have to be in the range 0...(num-1) then.
KeyType | Type of the key | |
DataType | Type of the data |
num | Number of objects for which memory should be reserved. Object IDs have to be in the range 0...(num-1) then. |