Fawkes API Fawkes Development Version
fawkes::gpp::SleepActionExecutor Class Reference

A Golog++ action executor that just sleeps for a certain amount of time. More...

Inheritance diagram for fawkes::gpp::SleepActionExecutor:

Public Member Functions

 SleepActionExecutor (Logger *logger)
 Constructor. More...
 
virtual ~SleepActionExecutor ()
 Destructor. More...
 
void start (std::shared_ptr< gologpp::Activity > activity) override
 Start the given activity. More...
 
void stop (std::shared_ptr< gologpp::Grounding< gologpp::Action > > activity) override
 Stop the given activity. More...
 
bool can_execute_activity (std::shared_ptr< gologpp::Activity > activity) const override
 Determine if this executor can execute the given activity. More...
 
- Public Member Functions inherited from fawkes::gpp::ActionExecutor
 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...
 

Additional Inherited Members

- Protected Attributes inherited from fawkes::gpp::ActionExecutor
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

A Golog++ action executor that just sleeps for a certain amount of time.

The action executor sleeps asynchronously and sets the activity to finished after the given time.

Author
Till Hofmann

Definition at line 34 of file sleep_action_executor.h.

Constructor & Destructor Documentation

◆ SleepActionExecutor()

fawkes::gpp::SleepActionExecutor::SleepActionExecutor ( Logger logger)

Constructor.

Initialize the executor.

Parameters
loggerA logger to use for logging messages

Definition at line 43 of file sleep_action_executor.cpp.

◆ ~SleepActionExecutor()

fawkes::gpp::SleepActionExecutor::~SleepActionExecutor ( )
virtual

Destructor.

Notify all running activities to cancel and wait for them before destruction.

Definition at line 50 of file sleep_action_executor.cpp.

Member Function Documentation

◆ can_execute_activity()

bool fawkes::gpp::SleepActionExecutor::can_execute_activity ( std::shared_ptr< gologpp::Activity >  activity) const
overridevirtual

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.

Implements fawkes::gpp::ActionExecutor.

Definition at line 59 of file sleep_action_executor.cpp.

Referenced by start().

◆ start()

void fawkes::gpp::SleepActionExecutor::start ( std::shared_ptr< gologpp::Activity >  activity)
overridevirtual

Start the given activity.

Parameters
activityThe activity to execute.

Implements fawkes::gpp::ActionExecutor.

Definition at line 65 of file sleep_action_executor.cpp.

References can_execute_activity().

◆ stop()

void fawkes::gpp::SleepActionExecutor::stop ( std::shared_ptr< gologpp::Grounding< gologpp::Action > >  activity)
overridevirtual

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.

Implements fawkes::gpp::ActionExecutor.

Definition at line 89 of file sleep_action_executor.cpp.


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