ABox interface. More...
#include <abox.h>
Public Types | |
enum | res_t { res_inv, res_done, res_dup, res_clash, res_none } |
ABox operation result. More... | |
typedef dword | slot_t |
ABox state slot ID type. | |
Public Member Functions | |
virtual | ~iABox () |
Destructor. | |
virtual slot_t | Save ()=0 |
Save ABox state. | |
virtual void | Restore (const slot_t i_nSlot)=0 |
Restore ABox state. | |
virtual res_t | Cache (const operator_t i_nConcept)=0 |
Add concept without filtering. | |
virtual res_t | Add (const operator_t i_nConcept)=0 |
Add concept with filtering. | |
virtual res_t | Add (const operator_t i_nRole, const operator_t i_nNode)=0 |
Add role. | |
virtual bool | Select (const operator_t i_nNode)=0 |
Select node. | |
virtual operator_t | CurNode ()=0 |
Select node. | |
virtual operator_t | NewNode (const operator_t i_nNode=0)=0 |
Create new node. | |
virtual res_t | Check (const operator_t i_nNode, const operator_t i_nConcept)=0 |
Check if concept belongs to node. | |
virtual list< operator_t > | Successors (const operator_t i_nRole)=0 |
Get node's successors for given role. | |
virtual void | Clear ()=0 |
Clear ABox. | |
virtual bool | Empty () const =0 |
Check if ABox is empty. | |
Static Public Member Functions | |
static spiABox | Create () |
Factory method for default implementation. |
ABox interface.
ABox interface definition. The default implementation implements the ABox as a directed graph. Each node represents an individual. Nodes are tagged with concepts IDs Edges are tagged with roles IDs.
enum DLITE::iABox::res_t |
DLITE::iABox::res_t DLITE::iABox::Add | ( | const operator_t | i_nRole, | |
const operator_t | i_nNode | |||
) | [pure virtual] |
Add role.
This method permits to add a role to the edge defined by the currently selected node and the i_nNode parameter.
i_nRole | Role's operator id. | |
i_nNode | Node id. |
DLITE::iABox::res_t DLITE::iABox::Add | ( | const operator_t | i_nConcept | ) | [pure virtual] |
Add concept with filtering.
This method permit to add a concept to the currently selected node, with filtering of the type. Only atomic concepts will be taken into account.
i_nConcept | Concept's operator id. |
DLITE::iABox::res_t DLITE::iABox::Cache | ( | const operator_t | i_nConcept | ) | [pure virtual] |
Add concept without filtering.
This method permit to add a concept to the currently selected node, regardless of the the operator type. This is typically used for caching.
i_nConcept | Concept's operator id. |
DLITE::iABox::res_t DLITE::iABox::Check | ( | const operator_t | i_nNode, | |
const operator_t | i_nConcept | |||
) | [pure virtual] |
Check if concept belongs to node.
This methods permits to check if a concept (or its complement) belongs to the selected node. Behaves like the Add method but without modifying the selected noode.
i_nConcept | Concept's operator id. |
void DLITE::iABox::Clear | ( | ) | [pure virtual] |
Clear ABox.
This method clears the ABox content.
static DLITE::spiABox DLITE::iABox::Create | ( | ) | [static] |
Factory method for default implementation.
This static method creates an ABox instance.
operator_t DLITE::iABox::CurNode | ( | ) | [pure virtual] |
Select node.
Thid method returns the name of the currently selected node.
bool DLITE::iABox::Empty | ( | ) | const [pure virtual] |
Check if ABox is empty.
This method permits to check if the ABox is empty.
operator_t DLITE::iABox::NewNode | ( | const operator_t | i_nNode = 0 |
) | [pure virtual] |
Create new node.
This metod permit to create a new node identified by an individual id. If no id is specified or if i_nNode is set to 0, a new node id will be generated.
i_nNode | (optional) node id (individual id). |
void DLITE::iABox::Restore | ( | const slot_t | i_nSlot | ) | [pure virtual] |
Restore ABox state.
This method restores the state of the ABox saved using the Save method. All states with a slot ID greater than the one restored are discarded.
i_nSlot | Id of the saved state to be restored. |
DLITE::iABox::slot_t DLITE::iABox::Save | ( | ) | [pure virtual] |
Save ABox state.
This method saves the the state of the ABox. It create a new slot and saves the state of the ABox in it.
bool DLITE::iABox::Select | ( | const operator_t | i_nNode | ) | [pure virtual] |
Select node.
This method permit to select a node. Subsequent Add and Cache operations will apply to this node.
i_nNode | selected node id (individual id). |
list< operator_t > DLITE::iABox::Successors | ( | const operator_t | i_nRole | ) | [pure virtual] |
Get node's successors for given role.
This method permits the retrieve the list of successors of the current node for the specified role,
i_nRole | role operator id. |