OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PlusLink.h
Go to the documentation of this file.
1 /*
2  * opencog/atoms/reduct/PlusLink.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 Plus 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  * Plus Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef _OPENCOG_PLUS_LINK_H
24 #define _OPENCOG_PLUS_LINK_H
25 
28 
29 namespace opencog
30 {
38 class PlusLink : public ArithmeticLink
39 {
40 protected:
41  virtual double konsd(double, double) const;
42  virtual Handle kons(const Handle&, const Handle&);
43 
44  void init(void);
45  PlusLink(Type, const HandleSeq& oset,
48 
49  PlusLink(Type, const Handle& a, const Handle& b,
52 
53 public:
54  PlusLink(const Handle& a, const Handle& b,
57 
58  PlusLink(const HandleSeq& oset,
61  PlusLink(Link& l);
62 };
63 
64 typedef std::shared_ptr<PlusLink> PlusLinkPtr;
65 static inline PlusLinkPtr PlusLinkCast(const Handle& h)
66  { AtomPtr a(h); return std::dynamic_pointer_cast<PlusLink>(a); }
68  { return std::dynamic_pointer_cast<PlusLink>(a); }
69 
70 // XXX temporary hack ...
71 #define createPlusLink std::make_shared<PlusLink>
72 
74 }
75 
76 #endif // _OPENCOG_PLUS_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 PlusLinkPtr PlusLinkCast(const Handle &h)
Definition: PlusLink.h:65
static TruthValuePtr NULL_TV()
Definition: TruthValue.cc:46
std::shared_ptr< PlusLink > PlusLinkPtr
Definition: PlusLink.h:64
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