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

#include <AtomspaceHTabler.h>

+ Inheritance diagram for opencog::AtomspaceHTabler:
+ Collaboration diagram for opencog::AtomspaceHTabler:

Public Member Functions

 AtomspaceHTabler (void)
 
virtual ~AtomspaceHTabler ()
 
void clearData ()
 
virtual LinkgetLink (Type, const std::vector< Handle > &) const
 
virtual NodegetNode (Type, const char *) const
 
virtual void storeAtom (Handle)
 
virtual std::vector< HandlegetIncomingSet (Handle) const
 
virtual AtomgetAtom (Handle) const
 
- Public Member Functions inherited from opencog::BackingStore
virtual ~BackingStore ()
 
virtual LinkPtr getLink (Type, const HandleSeq &) const =0
 
virtual void loadType (AtomTable &, Type)=0
 
virtual void barrier ()=0
 
virtual bool ignoreType (Type t) const
 
virtual bool ignoreAtom (Handle) const
 

Private Member Functions

KeySpec make_key (Handle)
 
KeySpec make_key (Type, const std::vector< Handle > &)
 
KeySpec make_key (Type, const char *)
 
void initTables ()
 

Private Attributes

ClientPtr c
 
TablePtr m_handle_table
 
TableMutatorPtr m_handle_mutator
 
TablePtr m_name_table
 
TableMutatorPtr m_name_mutator
 
TablePtr m_outset_table
 
TableMutatorPtr m_outset_mutator
 

Additional Inherited Members

- Public Attributes inherited from opencog::BackingStore
std::set< Type_ignored_types
 

Detailed Description

Persistent Atom storage, backed by Hypertable.

Definition at line 42 of file AtomspaceHTabler.h.

Constructor & Destructor Documentation

AtomspaceHTabler::AtomspaceHTabler ( void  )

Initializes the object, connects to Hypertable.

Exceptions
NetworkExceptionif the connection times out, usually indicating that the Hypertable servers are not running.

Definition at line 114 of file AtomspaceHTabler.cc.

virtual opencog::AtomspaceHTabler::~AtomspaceHTabler ( )
inlinevirtual

Definition at line 66 of file AtomspaceHTabler.h.

Member Function Documentation

void AtomspaceHTabler::clearData ( void  )

Erases everything stored in the Hypertable.

Definition at line 144 of file AtomspaceHTabler.cc.

Atom * AtomspaceHTabler::getAtom ( Handle  h) const
virtual

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

Implements opencog::BackingStore.

Definition at line 403 of file AtomspaceHTabler.cc.

References av, BUFF_SIZE, opencog::classserver(), opencog::ClassServer::isNode(), opencog::Atom::setAttentionValue(), opencog::Atom::setTruthValue(), and opencog::Handle::value().

+ Here is the caller graph for this function:

std::vector< Handle > AtomspaceHTabler::getIncomingSet ( Handle  h) const
virtual

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

Implements opencog::BackingStore.

Definition at line 372 of file AtomspaceHTabler.cc.

References BUFF_SIZE, and opencog::Handle::value().

Link * AtomspaceHTabler::getLink ( Type  t,
const std::vector< Handle > &  handles 
) const
virtual

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

This is a two-pass lookup: we get the handle from Outsettable and use it to index into the main Atomtable.

Definition at line 156 of file AtomspaceHTabler.cc.

References python.undocumented.blocksworld::t.

+ Here is the caller graph for this function:

Node * AtomspaceHTabler::getNode ( Type  t,
const char *  name 
) const
virtual

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

This is a two-pass lookup: we get the handle from Nametable and use it to index into the main Atomtable.

Implements opencog::BackingStore.

Definition at line 192 of file AtomspaceHTabler.cc.

+ Here is the caller graph for this function:

void AtomspaceHTabler::initTables ( void  )
private

Definition at line 123 of file AtomspaceHTabler.cc.

References attribute_schema, and handle_schema.

KeySpec opencog::AtomspaceHTabler::make_key ( Handle  )
private
KeySpec opencog::AtomspaceHTabler::make_key ( Type  ,
const std::vector< Handle > &   
)
private
KeySpec opencog::AtomspaceHTabler::make_key ( Type  ,
const char *   
)
private
void AtomspaceHTabler::storeAtom ( Handle  h)
virtual

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

Implements opencog::BackingStore.

Definition at line 223 of file AtomspaceHTabler.cc.

References av, BUFF_SIZE, opencog::TruthValue::getCount(), opencog::AttentionValue::getLTI(), opencog::TruthValue::getMean(), opencog::AttentionValue::getSTI(), opencog::AttentionValue::getVLTI(), python.undocumented.blocksworld::t, tv, and opencog::Handle::value().

+ Here is the caller graph for this function:

Member Data Documentation

ClientPtr opencog::AtomspaceHTabler::c
private

Definition at line 45 of file AtomspaceHTabler.h.

TableMutatorPtr opencog::AtomspaceHTabler::m_handle_mutator
private

Definition at line 47 of file AtomspaceHTabler.h.

TablePtr opencog::AtomspaceHTabler::m_handle_table
private

Definition at line 46 of file AtomspaceHTabler.h.

TableMutatorPtr opencog::AtomspaceHTabler::m_name_mutator
private

Definition at line 49 of file AtomspaceHTabler.h.

TablePtr opencog::AtomspaceHTabler::m_name_table
private

Definition at line 48 of file AtomspaceHTabler.h.

TableMutatorPtr opencog::AtomspaceHTabler::m_outset_mutator
private

Definition at line 51 of file AtomspaceHTabler.h.

TablePtr opencog::AtomspaceHTabler::m_outset_table
private

Definition at line 50 of file AtomspaceHTabler.h.


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