dlvhex
2.5.0
|
Lookup table for external atoms. More...
#include <include/dlvhex2/ExternalAtomTable.h>
Public Types | |
typedef Container::index < impl::AddressTag >::type | AddressIndex |
typedef Container::index < impl::PredicateTag >::type | PredicateIndex |
typedef PredicateIndex::iterator | PredicateIterator |
Public Member Functions | |
const ExternalAtom & | getByID (ID id) const throw () |
Retrieve by ID. | |
std::pair< PredicateIterator, PredicateIterator > | getRangeByPredicateID (ID id) const throw () |
Get all external atoms with certain predicate id. | |
ID | storeAndGetID (const ExternalAtom &atom) throw () |
Store atom, assuming it does not exist. | |
void | update (const ExternalAtom &oldStorage, ExternalAtom &newStorage) throw () |
Updates an external atom in the table. | |
std::ostream & | print (std::ostream &o, RegistryPtr reg) const throw () |
Prints the table in human-readable format. |
Lookup table for external atoms.
Definition at line 48 of file ExternalAtomTable.h.
typedef Container::index<impl::AddressTag>::type ExternalAtomTable::AddressIndex |
Definition at line 67 of file ExternalAtomTable.h.
typedef Container::index<impl::PredicateTag>::type ExternalAtomTable::PredicateIndex |
Definition at line 68 of file ExternalAtomTable.h.
typedef PredicateIndex::iterator ExternalAtomTable::PredicateIterator |
Definition at line 69 of file ExternalAtomTable.h.
const ExternalAtom & ExternalAtomTable::getByID | ( | ID | id | ) | const throw () [inline] |
Retrieve by ID.
Aassert that id.kind is correct. Assert that ID exists in table.
id | ID of an external atom. |
id
. Definition at line 116 of file ExternalAtomTable.h.
Referenced by Registry::getOutVariablesInID(), Registry::getPredicateOfAtom(), Registry::getVariablesInID(), and RawPrinter::print().
std::pair< ExternalAtomTable::PredicateIterator, ExternalAtomTable::PredicateIterator > ExternalAtomTable::getRangeByPredicateID | ( | ID | id | ) | const throw () [inline] |
Get all external atoms with certain predicate id.
id | External predicate ID. |
Definition at line 133 of file ExternalAtomTable.h.
std::ostream & ExternalAtomTable::print | ( | std::ostream & | o, |
RegistryPtr | reg | ||
) | const throw () |
Prints the table in human-readable format.
Implementation in Registry.cpp!
o | Stream to print to. |
reg | Registry used to resolve IDs. |
o
. Definition at line 198 of file Registry.cpp.
Referenced by Registry::print().
ID ExternalAtomTable::storeAndGetID | ( | const ExternalAtom & | atom | ) | throw () [inline] |
Store atom, assuming it does not exist.
atom | External atom to store. |
ID | of the stored external atom. |
Definition at line 143 of file ExternalAtomTable.h.
void ExternalAtomTable::update | ( | const ExternalAtom & | oldStorage, |
ExternalAtom & | newStorage | ||
) | throw () [inline] |
Updates an external atom in the table.
oldStorage must be from getByID() or from *const_iterator.
oldStorage | Old external atom. |
newStorage | New external atom. |
Definition at line 166 of file ExternalAtomTable.h.