DLITE::iABox Class Reference

ABox interface. More...

#include <abox.h>

List of all members.

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.

Detailed Description

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.


Member Enumeration Documentation

ABox operation result.

Enumerator:
res_inv 

Invalid value.

res_done 

Node/edge updated.

res_dup 

Node/edge already contains item.

res_clash 

Node/edge already contains item's complement.

res_none 

Item ignored.


Member Function Documentation

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.

Parameters:
i_nRole Role's operator id.
i_nNode Node id.
Returns:
ABox operation result.
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.

Parameters:
i_nConcept Concept's operator id.
Returns:
ABox operation result (iABox::res_none for non atomic concepts).
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.

Parameters:
i_nConcept Concept's operator id.
Returns:
ABox operation result,
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.

Parameters:
i_nConcept Concept's operator id.
Returns:
ABox operation result (iABox::res_none for non atomic concepts).
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.

Returns:
ABox instance smart pointer.
operator_t DLITE::iABox::CurNode (  )  [pure virtual]

Select node.

Thid method returns the name of the currently selected node.

Returns:
id of the currently selected node (individual id), 0 if no node is currently selected.
bool DLITE::iABox::Empty (  )  const [pure virtual]

Check if ABox is empty.

This method permits to check if the ABox is empty.

Returns:
true: ABox empty, false ABox not 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.

Parameters:
i_nNode (optional) node id (individual id).
Returns:
i_nNode if i_nNode not 0 or new node id if i_nNode set to 0.
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.

Parameters:
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.

Returns:
Saved state slot ID.
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.

Parameters:
i_nNode selected node id (individual id).
Returns:
true: found, false: not found.
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,

Parameters:
i_nRole role operator id.
Returns:
list of successors (individual ids) for role i_nRole..

The documentation for this class was generated from the following file:
 All Classes Files Functions Typedefs Enumerations Enumerator

Last modified on Sun Sep 26 23:21:27 2010
Copyright 2010 Michel Kinasz