OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::BackingStore Class Referenceabstract

#include <BackingStore.h>

+ Inheritance diagram for opencog::BackingStore:

Public Member Functions

virtual ~BackingStore ()
 
virtual LinkPtr getLink (Type, const HandleSeq &) const =0
 
virtual NodePtr getNode (Type, const char *) const =0
 
virtual AtomPtr getAtom (Handle) const =0
 
virtual HandleSeq getIncomingSet (Handle) const =0
 
virtual void storeAtom (Handle)=0
 
virtual void loadType (AtomTable &, Type)=0
 
virtual void barrier ()=0
 
virtual bool ignoreType (Type t) const
 
virtual bool ignoreAtom (Handle) const
 

Public Attributes

std::set< Type_ignored_types
 

Detailed Description

This class provides a simple, generic interface for dynamically storing/retreiving atoms from disk or other remote location or process. This class focuses on "on-demand" atom retreival, rather than on bulk-save/restore (although perhaps that should be provided as well.)

Definition at line 46 of file BackingStore.h.

Constructor & Destructor Documentation

virtual opencog::BackingStore::~BackingStore ( )
inlinevirtual

Definition at line 49 of file BackingStore.h.

Member Function Documentation

virtual void opencog::BackingStore::barrier ( )
pure virtual

Read-write synchronization barrier. All writes will be completed before this routine returns. This allows the backend to implement asynchronous writes, while still providing some control to those who need it. (Mostly the unit tests, at this time.)

Implemented in opencog::SQLBackingStore.

+ Here is the caller graph for this function:

virtual AtomPtr opencog::BackingStore::getAtom ( Handle  ) const
pure virtual

Return a pointer to an Atom associated with the given handle, if it exists; else return NULL.

Implemented in opencog::AtomspaceHTabler, and opencog::SQLBackingStore.

+ Here is the caller graph for this function:

virtual HandleSeq opencog::BackingStore::getIncomingSet ( Handle  ) const
pure virtual

Return a vector containing the handles of the entire incoming set of the indicated handle.

Implemented in opencog::AtomspaceHTabler, and opencog::SQLBackingStore.

+ Here is the caller graph for this function:

virtual LinkPtr opencog::BackingStore::getLink ( Type  ,
const HandleSeq  
) const
pure virtual

Return a pointer to a link of the indicated type and outset, if it exists; else return NULL.

Implemented in opencog::SQLBackingStore.

+ Here is the caller graph for this function:

virtual NodePtr opencog::BackingStore::getNode ( Type  ,
const char *   
) const
pure virtual

Return a pointer to a node of the indicated type and name, if it exists; else return NULL.

Implemented in opencog::AtomspaceHTabler, and opencog::SQLBackingStore.

+ Here is the caller graph for this function:

bool BackingStore::ignoreAtom ( Handle  h) const
virtual

Returns true if the backing store will ignore this atom, either because it is of an ignorable type, or is a link which contains an atom that is of an ignorable type.

Definition at line 30 of file BackingStore.cc.

References python.create_atoms_by_type::a, ignoreType(), and opencog::LinkCast().

+ Here is the caller graph for this function:

virtual bool opencog::BackingStore::ignoreType ( Type  t) const
inlinevirtual

Returns true if the backing store will ignore this type. This is used for performance optimization, as asking the backend to retreive an atom can take a long time. If an atom is of this given type, it will not be fetched.

Definition at line 105 of file BackingStore.h.

References _ignored_types.

+ Here is the caller graph for this function:

virtual void opencog::BackingStore::loadType ( AtomTable ,
Type   
)
pure virtual

Load all atoms of the given type, but only if they are not already in the AtomTable. (This avoids truth value merges between truth values stored in the backend, and truth values in the atomspace.)

Implemented in opencog::SQLBackingStore.

+ Here is the caller graph for this function:

virtual void opencog::BackingStore::storeAtom ( Handle  )
pure virtual

Recursively store the atom and anything in it's outgoing set. If the atom is already in storage, this will update it's truth value, etc.

Implemented in opencog::AtomspaceHTabler, and opencog::SQLBackingStore.

+ Here is the caller graph for this function:

Member Data Documentation

std::set<Type> opencog::BackingStore::_ignored_types

The set of ignored atom types.

Definition at line 119 of file BackingStore.h.


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