OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / f37be6a

Add new LiteralValueOfLink
f37be6a33fa9e05f2542342441343eb1a4a077a9
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-22T19:41:21.000Z

Changed files (1) +61 -0

opencog/atoms/flow/LiteralValueOfLink.h +61 -0
……@@ -0,0 +1,61 @@
1/*
2 * opencog/atoms/flow/LiteralValueOfLink.h
3 *
4 * Copyright (C) 2018 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_LITERAL_VALUE_OF_LINK_H
24#define _OPENCOG_LITERAL_VALUE_OF_LINK_H
25
26#include <opencog/atoms/flow/ValueOfLink.h>
27
28namespace opencog
29{
30/** \addtogroup grp_atomspace
31 * @{
32 */
33
34/// The LiteralValueOfLink returns the value on the indicated atom
35/// (first argument) at the indicated key (second argument). The
36/// literal value is returned; that value is NOT executed.
37///
38class LiteralValueOfLink : public ValueOfLink
39{
40private:
41 void init(void);
42
43public:
44 LiteralValueOfLink(const HandleSeq&&, Type=LITERAL_VALUE_OF_LINK);
45
46 LiteralValueOfLink(const LiteralValueOfLink&) = delete;
47 LiteralValueOfLink& operator=(const LiteralValueOfLink&) = delete;
48
49 // Return a pointer to the value at the specified key.
50 virtual ValuePtr execute(AtomSpace*, bool);
51
52 static Handle factory(const Handle&);
53};
54
55LINK_PTR_DECL(LiteralValueOfLink)
56#define createLiteralValueOfLink CREATE_DECL(LiteralValueOfLink)
57
58/** @}*/
59}
60
61#endif // _OPENCOG_LITERAL_VALUE_OF_LINK_H