25 #ifndef _OPENCOG_ATOMTABLE_H
26 #define _OPENCOG_ATOMTABLE_H
32 #include <boost/signals2.hpp>
34 #include <opencog/util/async_method_caller.h>
35 #include <opencog/util/exceptions.h>
36 #include <opencog/util/Logger.h>
37 #include <opencog/util/RandGen.h>
39 #include <opencog/atomspace/atom_types.h>
62 typedef boost::signals2::signal<void (const Handle&)>
AtomSignal;
64 typedef boost::signals2::signal<void (
const Handle&,
67 typedef boost::signals2::signal<void (
const Handle&,
82 friend class ::AtomTableUTest;
90 static std::recursive_mutex
_mtx;
203 template <
typename OutputIterator> OutputIterator
206 bool subclass =
false,
207 bool parent =
true)
const
209 std::lock_guard<std::recursive_mutex> lck(
_mtx);
218 template <
typename Function>
void
221 bool subclass =
false,
222 bool parent =
true)
const
224 std::lock_guard<std::recursive_mutex> lck(
_mtx);
244 std::lock_guard<std::recursive_mutex> lck(
_mtx);
257 if (a->_atomTable !=
this)
return;
258 std::lock_guard<std::recursive_mutex> lck(
_mtx);
356 #endif // _OPENCOG_ATOMTABLE_H
boost::signals2::connection addedTypeConnection
TVCHSigl & TVChangedSignal()
UnorderedHandleSet getHandlesByAV(AttentionValue::sti_t lowerBound, AttentionValue::sti_t upperBound=AttentionValue::MAXSTI) const
AtomSpace * getAtomSpace(void)
std::vector< Handle > HandleSeq
a list of handles
std::shared_ptr< Atom > AtomPtr
AtomTable * getAtomTable() const
Returns the AtomTable in which this Atom is inserted.
boost::signals2::signal< void(const Handle &, const TruthValuePtr &, const TruthValuePtr &)> TVCHSigl
std::shared_ptr< TruthValue > TruthValuePtr
std::shared_ptr< AttentionValue > AttentionValuePtr
std::unordered_set< Handle, handle_hash > _atom_set
AtomPtrSignal & removeAtomSignal()
static std::recursive_mutex _mtx
AtomTable(const AtomTable &)
Handle add(AtomPtr, bool async)
bool holds(Handle &h) const
iterator begin(Type, bool) const
std::shared_ptr< Link > LinkPtr
AtomPtrSet extract(Handle &handle, bool recursive=true)
AVCHSigl _AVChangedSignal
Handle getRandom(RandGen *rng) const
static NodePtr NodeCast(const Handle &h)
async_caller< AtomTable, AtomPtr > _index_queue
AVCHSigl & AVChangedSignal()
void updateImportanceIndex(AtomPtr a, int bin)
Handle getHandle(Type, std::string) const
size_t getNumNodes() const
boost::signals2::signal< void(const AtomPtr &)> AtomPtrSignal
short sti_t
short-term importance type
unsigned long UUID
UUID == Universally Unique Identifier.
boost::signals2::signal< void(const Handle &, const AttentionValuePtr &, const AttentionValuePtr &)> AVCHSigl
void foreachHandleByType(Function func, Type type, bool subclass=false, bool parent=true) const
LinkPtr getLink(Handle &h) const
size_t getNumAtomsOfType(Type type, bool subclass=true) const
size_t getNumLinks() const
static LinkPtr LinkCast(const Handle &h)
AtomTable & operator=(const AtomTable &)
boost::signals2::signal< void(const Handle &)> AtomSignal
AtomSignal _addAtomSignal
AtomSignal & addAtomSignal()
void updateImportance(Atom *, int)
std::shared_ptr< Node > NodePtr
void put_atom_into_index(AtomPtr &)
static AtomPtr factory(Type atom_type, AtomPtr atom)
friend class SavingLoading
TVCHSigl _TVChangedSignal
std::set< AtomPtr > AtomPtrSet
ImportanceIndex importanceIndex
unsigned short Type
type of Atoms, represented as short integer (16 bits)
std::unordered_set< Handle, handle_hash > UnorderedHandleSet
a hash that associates the handle to its unique identificator
UnorderedHandleSet getHandleSet(const AtomTable *, AttentionValue::sti_t, AttentionValue::sti_t) const
AtomPtrSignal _removeAtomSignal
OutputIterator getHandlesByType(OutputIterator result, Type type, bool subclass=false, bool parent=true) const
NodePtr getNode(Handle &h) const
static const sti_t MAXSTI