OpenCog Framework
Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
NameIndex.h
Go to the documentation of this file.
1
/*
2
* opencog/atomspace/NameIndex.h
3
*
4
* Copyright (C) 2008,2015 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_NAMEINDEX_H
23
#define _OPENCOG_NAMEINDEX_H
24
25
#include <
opencog/atomspace/Atom.h
>
26
#include <
opencog/atomspace/Node.h
>
27
#include <
opencog/atomspace/StringIndex.h
>
28
#include <
opencog/atomspace/types.h
>
29
30
namespace
opencog
31
{
32
40
class
NameIndex
:
41
public
StringIndex
42
{
43
public
:
44
void
insertAtom
(
Atom
*
a
)
45
{
46
Node
* n =
dynamic_cast<
Node
*
>
(
a
);
47
if
(NULL == n)
return
;
48
insert
(n->
getName
(),
a
);
49
}
50
void
removeAtom
(
Atom
*
a
)
51
{
52
Node
* n =
dynamic_cast<
Node
*
>
(
a
);
53
if
(NULL == n)
return
;
54
remove
(n->
getName
());
55
}
56
};
57
59
}
//namespace opencog
60
61
#endif // _OPENCOG_NAMEINDEX_H
opencog::Node
Definition:
Node.h:42
types.h
Node.h
opencog::Atom
Definition:
Atom.h:72
StringIndex.h
opencog::StringIndex::insert
void insert(const std::string &str, Atom *a)
Definition:
StringIndex.h:46
opencog::Node::getName
const std::string & getName() const
Definition:
Node.h:87
opencog::NameIndex::removeAtom
void removeAtom(Atom *a)
Definition:
NameIndex.h:50
opencog::NameIndex::insertAtom
void insertAtom(Atom *a)
Definition:
NameIndex.h:44
Atom.h
opencog::NameIndex
Definition:
NameIndex.h:40
python.create_atoms_by_type.a
tuple a
Definition:
create_atoms_by_type.py:13
opencog::StringIndex
Definition:
StringIndex.h:40
opencog
atomspace
NameIndex.h
Generated on Sat Aug 22 2015 21:00:13 for OpenCog Framework by
1.8.6