dlvhex
2.5.0
|
Lookup table for module atoms. More...
#include <include/dlvhex2/ModuleAtomTable.h>
Public Types | |
typedef Container::index < impl::AddressTag >::type | AddressIndex |
typedef AddressIndex::iterator | AddressIterator |
typedef Container::index < impl::PredicateTag >::type | PredicateIndex |
typedef PredicateIndex::iterator | PredicateIterator |
typedef Container::index < impl::ElementTag >::type | ElementIndex |
typedef ElementIndex::iterator | ElementIterator |
Public Member Functions | |
const ModuleAtom & | getByID (ID id) const throw () |
Get the ModuleAtom by ID. | |
ID | getIDByElement (ID predicate1, const Tuple &inputs1, ID outputAtom1) const throw () |
Get the ID of the module atom with predicate, inputs, and output atom specified. | |
std::pair< PredicateIterator, PredicateIterator > | getRangeByPredicateID (ID id) const throw () |
Get all module atoms with certain predicate id. | |
std::pair< AddressIterator, AddressIterator > | getAllByAddress () const throw () |
Get range over all atoms sorted by address. | |
ID | storeAndGetID (const ModuleAtom &atom) throw () |
Store atom, assuming it does not exist. | |
void | update (const ModuleAtom &oldStorage, ModuleAtom &newStorage) throw () |
Update a ModuleAtom in the table. |
Lookup table for module atoms.
Definition at line 49 of file ModuleAtomTable.h.
typedef Container::index<impl::AddressTag>::type ModuleAtomTable::AddressIndex |
Definition at line 77 of file ModuleAtomTable.h.
typedef AddressIndex::iterator ModuleAtomTable::AddressIterator |
Definition at line 78 of file ModuleAtomTable.h.
typedef Container::index<impl::ElementTag>::type ModuleAtomTable::ElementIndex |
Definition at line 81 of file ModuleAtomTable.h.
typedef ElementIndex::iterator ModuleAtomTable::ElementIterator |
Definition at line 82 of file ModuleAtomTable.h.
typedef Container::index<impl::PredicateTag>::type ModuleAtomTable::PredicateIndex |
Definition at line 79 of file ModuleAtomTable.h.
typedef PredicateIndex::iterator ModuleAtomTable::PredicateIterator |
Definition at line 80 of file ModuleAtomTable.h.
std::pair< ModuleAtomTable::AddressIterator, ModuleAtomTable::AddressIterator > ModuleAtomTable::getAllByAddress | ( | ) | const throw () [inline] |
Get range over all atoms sorted by address.
NOTE: you may need to lock the mutex also while iterating!
Definition at line 183 of file ModuleAtomTable.h.
References Table< ValueT, IndexT >::container, and Table< ValueT, IndexT >::mutex.
const ModuleAtom & ModuleAtomTable::getByID | ( | ID | id | ) | const throw () [inline] |
Get the ModuleAtom by ID.
id | ID of a module atom. ModuleAtom corresponding to id . |
Definition at line 132 of file ModuleAtomTable.h.
References Table< ValueT, IndexT >::container, and Table< ValueT, IndexT >::mutex.
Referenced by RawPrinter::print().
ID ModuleAtomTable::getIDByElement | ( | ID | predicate1, |
const Tuple & | inputs1, | ||
ID | outputAtom1 | ||
) | const throw () [inline] |
Get the ID of the module atom with predicate, inputs, and output atom specified.
Definition at line 149 of file ModuleAtomTable.h.
References Table< ValueT, IndexT >::container, ID_FAIL(), and Table< ValueT, IndexT >::mutex.
std::pair< ModuleAtomTable::PredicateIterator, ModuleAtomTable::PredicateIterator > ModuleAtomTable::getRangeByPredicateID | ( | ID | id | ) | const throw () [inline] |
Get all module atoms with certain predicate id.
NOTE: you may need to lock the mutex also while iterating!
id | A predicate ID. |
Definition at line 171 of file ModuleAtomTable.h.
References Table< ValueT, IndexT >::container, and Table< ValueT, IndexT >::mutex.
ID ModuleAtomTable::storeAndGetID | ( | const ModuleAtom & | atom | ) | throw () [inline] |
Store atom, assuming it does not exist.
atom | ModuleAtom to store. |
Definition at line 192 of file ModuleAtomTable.h.
References Table< ValueT, IndexT >::container, and Table< ValueT, IndexT >::mutex.
void ModuleAtomTable::update | ( | const ModuleAtom & | oldStorage, |
ModuleAtom & | newStorage | ||
) | throw () [inline] |
Update a ModuleAtom in the table.
oldStorage must be from getByID() or from *const_iterator.
oldStorage | Old ModuleAtom. |
newStorage | New ModuleAtom. |
Definition at line 215 of file ModuleAtomTable.h.
References Table< ValueT, IndexT >::container, and Table< ValueT, IndexT >::mutex.