OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::GenericEval Class Referenceabstract

#include <GenericEval.h>

+ Inheritance diagram for opencog::GenericEval:
+ Collaboration diagram for opencog::GenericEval:

Public Member Functions

 GenericEval (void)
 
virtual ~GenericEval ()
 
virtual bool input_pending ()
 
virtual void clear_pending ()
 
virtual bool eval_error (void)
 
virtual void begin_eval ()=0
 
virtual void eval_expr (const std::string &)=0
 
virtual std::string poll_result ()=0
 

Protected Attributes

std::string _input_line
 
bool _pending_input
 
bool _caught_error
 

Detailed Description

Definition at line 39 of file GenericEval.h.

Constructor & Destructor Documentation

opencog::GenericEval::GenericEval ( void  )
inline

Definition at line 47 of file GenericEval.h.

virtual opencog::GenericEval::~GenericEval ( )
inlinevirtual

Definition at line 51 of file GenericEval.h.

Member Function Documentation

virtual void opencog::GenericEval::begin_eval ( )
pure virtual

begin_eval() must be called in the same thread as poll_result() an it must be called before eval_expr(). The eval_expr() method may be called in the same thread, or a different one. The poll_result() method can be called at any time after begin_eval(). The poll_result() method might block, until results are available. It must return the empty string when there are no more results.

Implemented in opencog::PythonEval, and opencog::SchemeEval.

virtual void opencog::GenericEval::clear_pending ( )
inlinevirtual

Clear the error state, the input buffers, etc.

Definition at line 65 of file GenericEval.h.

References _caught_error, _input_line, and _pending_input.

virtual bool opencog::GenericEval::eval_error ( void  )
inlinevirtual

Return true if an error occured during the evaluation of the expression

Definition at line 75 of file GenericEval.h.

References _caught_error.

+ Here is the caller graph for this function:

virtual void opencog::GenericEval::eval_expr ( const std::string &  )
pure virtual
virtual bool opencog::GenericEval::input_pending ( )
inlinevirtual

Return true if the expression was incomplete, and more is expected (for example, more closing parens are expected)

Definition at line 57 of file GenericEval.h.

References _pending_input.

+ Here is the caller graph for this function:

virtual std::string opencog::GenericEval::poll_result ( )
pure virtual

Member Data Documentation

bool opencog::GenericEval::_caught_error
protected

Definition at line 44 of file GenericEval.h.

std::string opencog::GenericEval::_input_line
protected

Definition at line 42 of file GenericEval.h.

bool opencog::GenericEval::_pending_input
protected

Definition at line 43 of file GenericEval.h.


The documentation for this class was generated from the following file: