Fawkes API Fawkes Development Version
fawkes::gpp::ActionExecutor Class Referenceabstract

Abstract class to execute a Golog++ activity. More...

Inheritance diagram for fawkes::gpp::ActionExecutor:

Public Member Functions

 ActionExecutor (Logger *logger)
 Constructor of an abstract executor. More...
 
virtual void start (std::shared_ptr< gologpp::Activity > activity)=0
 Start the given activity. More...
 
virtual void stop (std::shared_ptr< gologpp::Grounding< gologpp::Action > > activity)=0
 Stop the given activity. More...
 
virtual bool can_execute_activity (std::shared_ptr< gologpp::Activity > activity) const =0
 Determine if this executor can execute the given activity. More...
 

Protected Attributes

std::shared_ptr< gologpp::Activity > running_activity_
 A pointer to the currently running activity. More...
 
Loggerlogger_
 The logger to use for logging messages. More...
 

Detailed Description

Abstract class to execute a Golog++ activity.

Any implementation is expected to give feedback about the execution by directly calling the activity's update function.

Author
Till Hofmann

Definition at line 34 of file action_executor.h.

Constructor & Destructor Documentation

◆ ActionExecutor()

fawkes::gpp::ActionExecutor::ActionExecutor ( fawkes::Logger logger)

Constructor of an abstract executor.

Parameters
loggerThe logger to use

Definition at line 58 of file action_executor.cpp.

Member Function Documentation

◆ can_execute_activity()

fawkes::gpp::ActionExecutor::can_execute_activity ( std::shared_ptr< gologpp::Activity >  activity) const
pure virtual

Determine if this executor can execute the given activity.

Parameters
activityThe activity to execute.
Returns
True iff the given activity can be executed by this executor.

Implemented in fawkes::gpp::BBMessageActionExecutor, fawkes::gpp::PrintActionExecutor, fawkes::gpp::RemoteSkillerActionExecutor, fawkes::gpp::SkillerActionExecutor, and fawkes::gpp::SleepActionExecutor.

◆ start()

fawkes::gpp::ActionExecutor::start ( std::shared_ptr< gologpp::Activity >  activity)
pure virtual

Start the given activity.

Parameters
activityThe activity to execute.

Implemented in fawkes::gpp::BBMessageActionExecutor, fawkes::gpp::PrintActionExecutor, fawkes::gpp::SkillerActionExecutor, and fawkes::gpp::SleepActionExecutor.

◆ stop()

fawkes::gpp::ActionExecutor::stop ( std::shared_ptr< gologpp::Grounding< gologpp::Action > >  activity)
pure virtual

Stop the given activity.

The executor is expected to keep track of the currently executed activity. Only stop the activity if the executor is actually executing it. If the given activity is not executed by this executor, do nothing.

Parameters
activityThe activity to stop.

Implemented in fawkes::gpp::BBMessageActionExecutor, fawkes::gpp::PrintActionExecutor, fawkes::gpp::SkillerActionExecutor, and fawkes::gpp::SleepActionExecutor.

Member Data Documentation

◆ logger_

◆ running_activity_

fawkes::gpp::ActionExecutor::running_activity_
protected

A pointer to the currently running activity.

Definition at line 43 of file action_executor.h.

Referenced by fawkes::gpp::SkillerActionExecutor::start(), and fawkes::gpp::SkillerActionExecutor::stop().


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