OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BindLink.h
Go to the documentation of this file.
1 /*
2  * opencog/atoms/BindLink.h
3  *
4  * Copyright (C) 2015 Linas Vepstas
5  * All Rights Reserved
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License v3 as
9  * published by the Free Software Foundation and including the exceptions
10  * at http://opencog.org/wiki/Licenses
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program; if not, write to:
19  * Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef _OPENCOG_BIND_LINK_H
24 #define _OPENCOG_BIND_LINK_H
25 
27 
28 namespace opencog
29 {
33 class BindLink : public PatternLink
34 {
35 protected:
36  void init(void);
37 
40 
41  // Overwrite PatternLink::extract_variables as BindLink has one
42  // more outgoing for the rewrite rule. In addition this method
43  // will initialize the rewrite term _implicand.
44  void extract_variables(const HandleSeq& oset);
45 
46  BindLink(Type, const HandleSeq&,
49 
50 public:
51  BindLink(const HandleSeq&,
54 
55  BindLink(Link &l);
56 
58  const Handle& get_implicand(void) { return _implicand; }
59 };
60 
61 typedef std::shared_ptr<BindLink> BindLinkPtr;
62 static inline BindLinkPtr BindLinkCast(const Handle& h)
63  { AtomPtr a(h); return std::dynamic_pointer_cast<BindLink>(a); }
65  { return std::dynamic_pointer_cast<BindLink>(a); }
66 
67 // XXX temporary hack ...
68 #define createBindLink std::make_shared<BindLink>
69 
71 }
72 
73 #endif // _OPENCOG_BIND_LINK_H
std::vector< Handle > HandleSeq
a list of handles
Definition: Handle.h:246
std::shared_ptr< Atom > AtomPtr
Definition: Handle.h:48
std::shared_ptr< TruthValue > TruthValuePtr
Definition: TruthValue.h:85
std::shared_ptr< AttentionValue > AttentionValuePtr
static BindLinkPtr BindLinkCast(const Handle &h)
Definition: BindLink.h:62
std::shared_ptr< BindLink > BindLinkPtr
Definition: BindLink.h:61
static TruthValuePtr DEFAULT_TV()
Definition: TruthValue.cc:52
static AttentionValuePtr DEFAULT_AV()
to be used as default attention value
unsigned short Type
type of Atoms, represented as short integer (16 bits)
Definition: types.h:40