OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AtomspaceHTabler.h
Go to the documentation of this file.
1 /*
2  * opencog/hypertable/AtomspaceHTabler.h
3  *
4  * Copyright (C) 2009-2011 OpenCog Foundation
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Affero General Public License v3 as
8  * published by the Free Software Foundation and including the exceptions
9  * at http://opencog.org/wiki/Licenses
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU Affero General Public License
17  * along with this program; if not, write to:
18  * Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #ifndef _OPENCOG_ATOMSPACE_HTABLER_H
23 #define _OPENCOG_ATOMSPACE_HTABLER_H
24 
25 #include "Common/Compat.h"
26 #include "Hypertable/Lib/Client.h"
27 
29 #include "opencog/atomspace/Node.h"
30 #include "opencog/atomspace/Link.h"
32 
33 namespace opencog
34 {
43 {
44  private:
45  ClientPtr c;
46  TablePtr m_handle_table;
47  TableMutatorPtr m_handle_mutator;
48  TablePtr m_name_table;
49  TableMutatorPtr m_name_mutator;
50  TablePtr m_outset_table;
51  TableMutatorPtr m_outset_mutator;
52 
53  KeySpec make_key(Handle);
54  KeySpec make_key(Type, const std::vector<Handle>&);
55  KeySpec make_key(Type, const char*);
56 
57  void initTables();
58  public:
59 
65  AtomspaceHTabler(void);
66  virtual ~AtomspaceHTabler(){}
67 
71  void clearData();
72 
77  virtual Link * getLink(Type, const std::vector<Handle>&) const;
78 
83  virtual Node * getNode(Type, const char *) const;
84 
90  virtual void storeAtom(Handle);
91 
96  virtual std::vector<Handle> getIncomingSet(Handle) const;
97 
102  virtual Atom * getAtom(Handle) const;
103 };
104 
106 } // namespace opencog
107 
108 #endif // _OPENCOG_ATOMSPACE_HTABLER_H
KeySpec make_key(Handle)
virtual void storeAtom(Handle)
TableMutatorPtr m_handle_mutator
virtual Node * getNode(Type, const char *) const
virtual Atom * getAtom(Handle) const
TableMutatorPtr m_outset_mutator
unsigned short Type
type of Atoms, represented as short integer (16 bits)
Definition: types.h:40
TableMutatorPtr m_name_mutator
virtual Link * getLink(Type, const std::vector< Handle > &) const
virtual std::vector< Handle > getIncomingSet(Handle) const