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
GenericEval.h
Go to the documentation of this file.
1
/*
2
* GenericEval.h
3
*
4
* Template for a generic shell-oriented evaluator
5
* Copyright (c) 2008, 2013, 2014 Linas Vepstas <linas@linas.org>
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_GENERIC_EVAL_H
24
#define _OPENCOG_GENERIC_EVAL_H
25
26
#include <string>
27
34
namespace
opencog {
39
class
GenericEval
40
{
41
protected
:
42
std::string
_input_line
;
43
bool
_pending_input
;
44
bool
_caught_error
;
45
46
public
:
47
GenericEval
(
void
) :
48
_input_line
(
""
),
49
_pending_input
(false),
50
_caught_error
(false) {}
51
virtual
~GenericEval
() {}
52
57
virtual
bool
input_pending
()
58
{
59
return
_pending_input
;
60
}
61
65
virtual
void
clear_pending
()
66
{
67
_input_line
=
""
;
68
_pending_input
=
false
;
69
_caught_error
=
false
;
70
}
71
75
virtual
bool
eval_error
(
void
)
76
{
77
return
_caught_error
;
78
}
79
88
virtual
void
begin_eval
() = 0;
89
virtual
void
eval_expr
(
const
std::string&) = 0;
90
virtual
std::string
poll_result
() = 0;
91
};
92
94
}
95
96
#endif // _OPENCOG_GENERIC_EVAL_H
opencog::GenericEval::clear_pending
virtual void clear_pending()
Definition:
GenericEval.h:65
opencog::GenericEval::~GenericEval
virtual ~GenericEval()
Definition:
GenericEval.h:51
opencog::GenericEval::_pending_input
bool _pending_input
Definition:
GenericEval.h:43
opencog::GenericEval
Definition:
GenericEval.h:39
opencog::GenericEval::poll_result
virtual std::string poll_result()=0
opencog::GenericEval::eval_error
virtual bool eval_error(void)
Definition:
GenericEval.h:75
opencog::GenericEval::begin_eval
virtual void begin_eval()=0
opencog::GenericEval::eval_expr
virtual void eval_expr(const std::string &)=0
opencog::GenericEval::_input_line
std::string _input_line
Definition:
GenericEval.h:42
opencog::GenericEval::input_pending
virtual bool input_pending()
Definition:
GenericEval.h:57
opencog::GenericEval::GenericEval
GenericEval(void)
Definition:
GenericEval.h:47
opencog::GenericEval::_caught_error
bool _caught_error
Definition:
GenericEval.h:44
opencog
shell
GenericEval.h
Generated on Sat Aug 22 2015 21:00:14 for OpenCog Framework by
1.8.6