dlvhex  2.5.0
ExternalAtomTable Class Reference

Lookup table for external atoms. More...

#include <include/dlvhex2/ExternalAtomTable.h>

Inheritance diagram for ExternalAtomTable:
Collaboration diagram for ExternalAtomTable:

Public Types

typedef Container::index
< impl::AddressTag >::type 
AddressIndex
typedef Container::index
< impl::PredicateTag >::type 
PredicateIndex
typedef PredicateIndex::iterator PredicateIterator

Public Member Functions

const ExternalAtomgetByID (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.

Detailed Description

Lookup table for external atoms.

Definition at line 48 of file ExternalAtomTable.h.


Member Typedef Documentation

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.


Member Function Documentation

const ExternalAtom & ExternalAtomTable::getByID ( ID  id) const throw () [inline]

Retrieve by ID.

Aassert that id.kind is correct. Assert that ID exists in table.

Parameters:
idID of an external atom.
Returns:
External atom corresponding to id.

Definition at line 116 of file ExternalAtomTable.h.

Referenced by Registry::getOutVariablesInID(), Registry::getPredicateOfAtom(), Registry::getVariablesInID(), and RawPrinter::print().

Get all external atoms with certain predicate id.

Parameters:
idExternal predicate ID.
Returns:
Pair of begin and end iterator representing all external atoms in the table using the given predicate.

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!

Parameters:
oStream to print to.
regRegistry used to resolve IDs.
Returns:
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.

Parameters:
atomExternal atom to store.
IDof 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.

Parameters:
oldStorageOld external atom.
newStorageNew external atom.

Definition at line 166 of file ExternalAtomTable.h.


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