25 #include <opencog/atomspace/atom_types.h>
30 using namespace opencog;
51 Type t = a->getType();
55 if (NULL == l)
return;
57 hsi.
insert(l->getOutgoingSet(), a->getHandle());
62 Type t = a->getType();
66 if (NULL == l)
return;
68 hsi.
remove(l->getOutgoingSet());
73 if (t >=
idx.size())
throw RuntimeException(TRACE_INFO,
74 "Index out of bounds for atom type (t = %lu)", t);
91 for (
Type s = 0; s < max; s++)
96 if (s >=
idx.size())
throw RuntimeException(TRACE_INFO,
97 "Index out of bounds for atom type (s = %lu)", s);
std::vector< HandleSeqIndex > idx
const Handle & get(const HandleSeq &seq) const
void remove(bool(*)(const Handle &))
std::vector< Handle > HandleSeq
a list of handles
UnorderedHandleSet getHandleSet(Type type, const HandleSeq &, bool subclass) const
std::shared_ptr< Atom > AtomPtr
void removeAtom(const AtomPtr &)
std::shared_ptr< Link > LinkPtr
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
static const Handle UNDEFINED
void insert(const HandleSeq &seq, const Handle &h)
Type getNumberOfClasses()
void insertAtom(const AtomPtr &)
static LinkPtr LinkCast(const Handle &h)
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
Handle getHandle(Type type, const HandleSeq &) const
void remove(const HandleSeq &seq)