dlvhex  2.5.0
Table< ValueT, IndexT > Class Template Reference

Implements a lookup table for custom key and value types. More...

#include <include/dlvhex2/Table.h>

Inheritance diagram for Table< ValueT, IndexT >:
Collaboration diagram for Table< ValueT, IndexT >:

Public Types

typedef
boost::multi_index_container
< ValueT, IndexT > 
Container
typedef boost::shared_lock
< boost::shared_mutex > 
ReadLock
typedef boost::unique_lock
< boost::shared_mutex > 
WriteLock

Public Member Functions

 Table ()
 Constructor.
std::ostream & print (std::ostream &o) const
 Prints the table in human-readable format.
 Table (const Table &other)
 Copy-constructor.
Tableoperator= (const Table &other)
 Assignment operator.
unsigned getSize () const
 Retrieves the size of the table.

Data Fields

boost::shared_mutex mutex
 Multithreading mutex.

Protected Attributes

Container container
 Internal container.

Detailed Description

template<typename ValueT, typename IndexT>
class Table< ValueT, IndexT >

Implements a lookup table for custom key and value types.

Definition at line 82 of file Table.h.


Member Typedef Documentation

template<typename ValueT, typename IndexT>
typedef boost::multi_index_container<ValueT, IndexT> Table< ValueT, IndexT >::Container

Definition at line 88 of file Table.h.

template<typename ValueT, typename IndexT>
typedef boost::shared_lock<boost::shared_mutex> Table< ValueT, IndexT >::ReadLock

Definition at line 93 of file Table.h.

template<typename ValueT, typename IndexT>
typedef boost::unique_lock<boost::shared_mutex> Table< ValueT, IndexT >::WriteLock

Definition at line 94 of file Table.h.


Constructor & Destructor Documentation

template<typename ValueT, typename IndexT>
Table< ValueT, IndexT >::Table ( ) [inline]

Constructor.

Definition at line 104 of file Table.h.

template<typename ValueT, typename IndexT>
Table< ValueT, IndexT >::Table ( const Table< ValueT, IndexT > &  other) [inline]

Copy-constructor.

Parameters:
otherOther table.

Definition at line 122 of file Table.h.


Member Function Documentation

template<typename ValueT, typename IndexT>
unsigned Table< ValueT, IndexT >::getSize ( ) const [inline]

Retrieves the size of the table.

Returns:
Table size.

Definition at line 136 of file Table.h.

template<typename ValueT, typename IndexT>
Table& Table< ValueT, IndexT >::operator= ( const Table< ValueT, IndexT > &  other) [inline]

Assignment operator.

Parameters:
otherOther table.
Returns:
This table.

Definition at line 129 of file Table.h.

template<typename ValueT , typename IndexT >
std::ostream & Table< ValueT, IndexT >::print ( std::ostream &  o) const

Prints the table in human-readable format.

Parameters:
oStream to print to.
Returns:
o.

Reimplemented in ModuleTable.

Definition at line 144 of file Table.h.


Field Documentation

template<typename ValueT, typename IndexT>
Container Table< ValueT, IndexT >::container [protected]
template<typename ValueT, typename IndexT>
boost::shared_mutex Table< ValueT, IndexT >::mutex [mutable]

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