OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PutLink.h
Go to the documentation of this file.
1 /*
2  * opencog/atoms/core/PutLink.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 Put 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  * Put Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef _OPENCOG_PUT_LINK_H
24 #define _OPENCOG_PUT_LINK_H
25 
28 
29 namespace opencog
30 {
52 class PutLink : public FreeLink
53 {
54 protected:
55  void init(void);
56  Handle substitute_nocheck(const Handle&, const HandleSeq&) const;
57  Handle do_reduce(void) const;
58 
59  PutLink(Type, const HandleSeq& oset,
62 
63  PutLink(Type, const Handle& a,
66 
67  PutLink(Type, const Handle& a, const Handle& b,
70 public:
71  PutLink(const HandleSeq& oset,
74  PutLink(const Handle& a,
77 
78  PutLink(Link& l);
79  virtual ~PutLink() {}
80 
81  virtual Handle reduce(void);
82 };
83 
84 typedef std::shared_ptr<PutLink> PutLinkPtr;
85 static inline PutLinkPtr PutLinkCast(const Handle& h)
86  { AtomPtr a(h); return std::dynamic_pointer_cast<PutLink>(a); }
88  { return std::dynamic_pointer_cast<PutLink>(a); }
89 
90 // XXX temporary hack ...
91 #define createPutLink std::make_shared<PutLink>
92 
94 }
95 
96 #endif // _OPENCOG_PUT_LINK_H
static PutLinkPtr PutLinkCast(const Handle &h)
Definition: PutLink.h:85
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 TruthValuePtr NULL_TV()
Definition: TruthValue.cc:46
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
std::shared_ptr< PutLink > PutLinkPtr
Definition: PutLink.h:84