|
OpenCog Framework
Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
|
#include <TypeIndex.h>
Inheritance diagram for opencog::TypeIndex:
Collaboration diagram for opencog::TypeIndex:Classes | |
| class | iterator |
Public Member Functions | |
| TypeIndex (void) | |
| void | resize (void) |
| void | insertAtom (Atom *a) |
| void | removeAtom (Atom *a) |
| size_t | getNumAtomsOfType (Type type, bool subclass) const |
| iterator | begin (Type, bool) const |
| iterator | end (void) const |
Public Member Functions inherited from opencog::FixedIntegerIndex | |
| ~FixedIntegerIndex () | |
| void | insert (size_t i, Atom *a) |
| void | remove (size_t i, Atom *a) |
| size_t | size (size_t i) const |
| size_t | size (void) const |
Private Attributes | |
| size_t | num_types |
Additional Inherited Members | |
Protected Member Functions inherited from opencog::FixedIntegerIndex | |
| void | resize (size_t sz) |
Protected Attributes inherited from opencog::FixedIntegerIndex | |
| std::vector< UnorderedAtomSet > | idx |
Implements an integer index as an RB-tree (C++ set) That is, given an atom Type, this returns all of the Handles for that Type.
The primary interface for this is an iterator, and that is because the index will typically contain millions of atoms, and this is far too much to try to return in some temporary array. Iterating is much safer.
Definition at line 52 of file TypeIndex.h.
| TypeIndex::TypeIndex | ( | void | ) |
Definition at line 28 of file TypeIndex.cc.
References resize().
| TypeIndex::iterator TypeIndex::begin | ( | Type | t, |
| bool | sub | ||
| ) | const |
Definition at line 66 of file TypeIndex.cc.
References opencog::classserver(), opencog::TypeIndex::iterator::currtype, opencog::FixedIntegerIndex::idx, opencog::TypeIndex::iterator::s, opencog::TypeIndex::iterator::se, opencog::TypeIndex::iterator::send, and opencog::TypeIndex::iterator::type.
Here is the caller graph for this function:| TypeIndex::iterator TypeIndex::end | ( | void | ) | const |
Definition at line 89 of file TypeIndex.cc.
References opencog::TypeIndex::iterator::currtype, opencog::FixedIntegerIndex::idx, num_types, opencog::TypeIndex::iterator::s, opencog::TypeIndex::iterator::se, and opencog::TypeIndex::iterator::send.
Here is the caller graph for this function:| size_t TypeIndex::getNumAtomsOfType | ( | Type | type, |
| bool | subclass | ||
| ) | const |
Definition at line 39 of file TypeIndex.cc.
References opencog::classserver(), opencog::FixedIntegerIndex::idx, opencog::TypeIndex::iterator::s, opencog::TypeIndex::iterator::send, and opencog::TypeIndex::iterator::type.
Here is the caller graph for this function:
|
inline |
Definition at line 59 of file TypeIndex.h.
References python.create_atoms_by_type::a, opencog::Atom::getType(), and opencog::FixedIntegerIndex::insert().
Here is the caller graph for this function:
|
inline |
Definition at line 63 of file TypeIndex.h.
References python.create_atoms_by_type::a, and opencog::Atom::getType().
Here is the caller graph for this function:| void TypeIndex::resize | ( | void | ) |
Definition at line 33 of file TypeIndex.cc.
References opencog::classserver(), opencog::ClassServer::getNumberOfClasses(), num_types, and opencog::FixedIntegerIndex::resize().
Here is the caller graph for this function:
|
private |
Definition at line 55 of file TypeIndex.h.