OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IncomingIndex.h
Go to the documentation of this file.
1 /*
2  * opencog/atomspace/IncomingIndex.h
3  *
4  * Copyright (C) 2008,2009,2013 Linas Vepstas <linasvepstas@gmail.com>
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_INCOMING_INDEX_H
23 #define _OPENCOG_INCOMING_INDEX_H
24 
25 #include <set>
26 #include <vector>
27 
30 
31 namespace opencog
32 {
50 {
51  private:
53  public:
54  IncomingIndex(void);
55  void insertAtom(const AtomPtr& a);
56  void removeAtom(const AtomPtr& a);
57  void resize();
58 
60 
61  class iterator
62  : public std::iterator<std::forward_iterator_tag, Handle>
63  {
64  friend class IncomingIndex;
65  public:
68  iterator& operator++(int);
70  bool operator==(iterator);
71  bool operator!=(iterator);
72  Handle operator*(void);
73  private:
76  UnorderedHandleSet::const_iterator _s;
77  UnorderedHandleSet::const_iterator _e;
78  };
79 
80  iterator begin(Handle) const;
81  iterator end(void) const;
82 
83 };
84 
86 } //namespace opencog
87 
88 #endif // _OPENCOG_INCOMING_INDEX_H
HandleSetIndex idx
Definition: IncomingIndex.h:52
std::shared_ptr< Atom > AtomPtr
Definition: Handle.h:48
iterator begin(Handle) const
iterator end(void) const
void removeAtom(const AtomPtr &a)
iterator & operator=(iterator)
UnorderedHandleSet::const_iterator _e
Definition: IncomingIndex.h:77
const UnorderedHandleSet & getIncomingSet(Handle) const
std::unordered_set< Handle, handle_hash > UnorderedHandleSet
a hash that associates the handle to its unique identificator
Definition: Handle.h:250
void insertAtom(const AtomPtr &a)
UnorderedHandleSet::const_iterator _s
Definition: IncomingIndex.h:76