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

#include <ExecutionOutputLink.h>

+ Inheritance diagram for opencog::ExecutionOutputLink:
+ Collaboration diagram for opencog::ExecutionOutputLink:

Public Member Functions

 ExecutionOutputLink (const HandleSeq &oset, TruthValuePtr tv=TruthValue::NULL_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
 ExecutionOutputLink (const Handle &schema, const Handle &args, TruthValuePtr tv=TruthValue::NULL_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
 ExecutionOutputLink (Link &l)
 
virtual Handle execute (AtomSpace *=NULL) const
 
- Public Member Functions inherited from opencog::Atom
virtual ~Atom ()
 
Type getType () const
 
bool isType (Type t, bool subclass) const
 
Handle getHandle ()
 
AttentionValuePtr getAttentionValue ()
 
void setAttentionValue (AttentionValuePtr)
 Sets the AttentionValue object of the atom. More...
 
AttentionValue::sti_t getSTI ()
 Handy-dandy convenience getters for attention values. More...
 
AttentionValue::lti_t getLTI ()
 
AttentionValue::vlti_t getVLTI ()
 
void setSTI (AttentionValue::sti_t stiValue)
 
void setLTI (AttentionValue::lti_t ltiValue)
 
void incVLTI ()
 
void decVLTI ()
 
TruthValuePtr getTruthValue ()
 
void setTruthValue (TruthValuePtr)
 Sets the TruthValue object of the atom. More...
 
void merge (TruthValuePtr)
 
Handle tvmerge (TruthValuePtr tv)
 
size_t getIncomingSetSize ()
 Get the size of the incoming set. More...
 
IncomingSet getIncomingSet ()
 
template<typename OutputIterator >
OutputIterator getIncomingSet (OutputIterator result)
 
template<class T >
bool foreach_incoming (bool(T::*cb)(const Handle &), T *data)
 
template<typename OutputIterator >
OutputIterator getIncomingSetByType (OutputIterator result, Type type, bool subclass=false)
 
IncomingSet getIncomingSetByType (Type type, bool subclass=false)
 

Static Private Member Functions

static Handle do_execute (AtomSpace *, const Handle &schema, const Handle &args)
 

Additional Inherited Members

- Protected Types inherited from opencog::Atom
typedef std::shared_ptr< InSetInSetPtr
 
- Protected Member Functions inherited from opencog::Atom
 Atom (Type t, TruthValuePtr tv=TruthValue::DEFAULT_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
 
void keep_incoming_set ()
 
void drop_incoming_set ()
 
void insert_atom (LinkPtr)
 Add an atom to the incoming set. More...
 
void remove_atom (LinkPtr)
 Remove an atom from the incoming set. More...
 
- Protected Attributes inherited from opencog::Atom
UUID _uuid
 
AtomTable_atomTable
 
Type _type
 
char _flags
 
TruthValuePtr _truthValue
 
AttentionValuePtr _attentionValue
 
std::mutex _mtx
 
InSetPtr _incoming_set
 

Detailed Description

Definition at line 35 of file ExecutionOutputLink.h.

Constructor & Destructor Documentation

ExecutionOutputLink::ExecutionOutputLink ( const HandleSeq oset,
TruthValuePtr  tv = TruthValue::NULL_TV(),
AttentionValuePtr  av = AttentionValue::DEFAULT_AV() 
)

Definition at line 39 of file ExecutionOutputLink.cc.

ExecutionOutputLink::ExecutionOutputLink ( const Handle schema,
const Handle args,
TruthValuePtr  tv = TruthValue::NULL_TV(),
AttentionValuePtr  av = AttentionValue::DEFAULT_AV() 
)

Definition at line 53 of file ExecutionOutputLink.cc.

References opencog::Atom::getType().

ExecutionOutputLink::ExecutionOutputLink ( Link l)

Definition at line 67 of file ExecutionOutputLink.cc.

References opencog::Atom::getType().

Member Function Documentation

Handle ExecutionOutputLink::do_execute ( AtomSpace as,
const Handle gsn,
const Handle cargs 
)
staticprivate

do_execute – execute the GroundedSchemaNode of the ExecutionOutputLink

Expects "gsn" to be a GroundedSchemaNode Expects "args" to be a ListLink Executes the GroundedSchemaNode, supplying the args as argument

Definition at line 101 of file ExecutionOutputLink.cc.

References opencog::AtomSpace::add_link(), opencog::SchemeEval::apply(), opencog::PythonEval::apply(), benchmark::args, opencog::GenericEval::eval_error(), opencog::Instantiator::execute(), opencog::SchemeEval::get_evaluator(), opencog::PythonEval::instance(), opencog::LinkCast(), and opencog::NodeCast().

+ Here is the caller graph for this function:

Handle ExecutionOutputLink::execute ( AtomSpace as = NULL) const
virtual

execute – execute the function defined in an ExecutionOutputLink

Each ExecutionOutputLink should have the form:

ExecutionOutputLink
    GroundedSchemaNode "lang: func_name"
    ListLink
        SomeAtom
        OtherAtom

The "lang:" should be either "scm:" for scheme, or "py:" for python. This method will then invoke "func_name" on the provided ListLink of arguments to the function.

Reimplemented from opencog::FunctionLink.

Definition at line 90 of file ExecutionOutputLink.cc.

References opencog::Link::_outgoing, and do_execute().


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