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

#include <IncomingIndex.h>

+ Collaboration diagram for opencog::IncomingIndex:

Classes

class  iterator
 

Public Member Functions

 IncomingIndex (void)
 
void insertAtom (const AtomPtr &a)
 
void removeAtom (const AtomPtr &a)
 
void resize ()
 
const UnorderedHandleSetgetIncomingSet (Handle) const
 
iterator begin (Handle) const
 
iterator end (void) const
 

Private Attributes

HandleSetIndex idx
 

Detailed Description

Implements a Handle index array of RB-trees (C++ set) Given a Handle, this returns the incoming set of that handle.

Todo:
The iterator is NOT thread-safe against the insertion or removal of atoms! Either inserting or removing an atom will cause the iterator references to be freed, leading to mystery crashes!

The const UnorderedHandleSet& returned by the getIncomingSet() method will also become invalid if an atom is inserted or deleted (for that particular IncomingSet).

Definition at line 49 of file IncomingIndex.h.

Constructor & Destructor Documentation

IncomingIndex::IncomingIndex ( void  )

Definition at line 29 of file IncomingIndex.cc.

Member Function Documentation

const UnorderedHandleSet & IncomingIndex::getIncomingSet ( Handle  h) const

Definition at line 104 of file IncomingIndex.cc.

References opencog::HandleSetIndex::get(), and idx.

void IncomingIndex::resize ( )

Definition at line 33 of file IncomingIndex.cc.

Member Data Documentation

HandleSetIndex opencog::IncomingIndex::idx
private

Definition at line 52 of file IncomingIndex.h.


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