Skill Class Reference

#include <RobotAPI/libraries/skills/provider/Skill.h>

+ Inheritance diagram for Skill:

Data Structures

struct  ExitInput
 
struct  ExitResult
 
struct  InitInput
 
struct  InitResult
 
struct  MainInput
 
struct  MainResult
 

Public Types

using CallbackT = std::function< void(const aron::data::DictPtr &)>
 

Public Member Functions

bool checkWhetherSkillShouldStopASAP () const
 
MainResult executeFullSkill (const MainInput &in)
 Do init, main, exit together. More...
 
ExitResult exitSkill (const ExitInput &in)
 
SkillID getSkillId () const
 The id of the skill (combination of provider and name must be unique). More...
 
InitResult initSkill (const InitInput &in)
 
bool isSkillAvailable (const InitInput &in) const
 
MainResult mainOfSkill (const MainInput &in)
 
void notifySkillToStopASAP ()
 
void resetSkill ()
 
 Skill ()=delete
 
 Skill (const SkillDescription &)
 
void waitForDependenciesOfSkill ()
 
virtual ~Skill ()=default
 
- Public Member Functions inherited from Logging
SpamFilterDataPtr deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
 disables the logging for the current line for the given amount of seconds. More...
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More...
 
void setTag (const LogTag &tag)
 
void setTag (const std::string &tagName)
 
virtual ~Logging ()
 

Data Fields

const SkillDescription description
 The descripion of the skill, which will be available via the provider/manager. More...
 
armarx::core::time::DateTime exited = armarx::core::time::DateTime::Invalid()
 
manager::dti::SkillManagerInterfacePrx manager = nullptr
 proxy that called the skills. Will be set from provider and is const afterwards More...
 
std::string providerName = "INVALID PROVIDER NAME"
 the provider that owns this skill. Will be set from provider and is const afterwards More...
 
armarx::core::time::DateTime started = armarx::core::time::DateTime::Invalid()
 running params More...
 

Protected Member Functions

void _exit ()
 
void _init ()
 
void _main ()
 
void installConditionWithCallback (std::function< bool()> &&f, std::function< void()> &&cb)
 install a condition which is frequently checked from the conditionCheckingThread More...
 
void notifyTimeoutReached ()
 
- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtrgetLogSender () const
 Retrieve log sender. More...
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 

Protected Attributes

std::vector< std::pair< std::function< bool()>, std::function< void()> > > callbacks
 active conditions. First is condition (bool return func) More...
 
std::mutex callbacksMutex
 
std::atomic_bool running = false
 Use conditions this way. More...
 
std::atomic_bool stopped = false
 
std::atomic_bool timeoutReached = false
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Detailed Description

Definition at line 29 of file Skill.h.

Member Typedef Documentation

◆ CallbackT

using CallbackT = std::function<void(const aron::data::DictPtr&)>

Definition at line 32 of file Skill.h.

Constructor & Destructor Documentation

◆ Skill() [1/2]

Skill ( )
delete

◆ Skill() [2/2]

Skill ( const SkillDescription desc)

Definition at line 7 of file Skill.cpp.

◆ ~Skill()

virtual ~Skill ( )
virtualdefault

Member Function Documentation

◆ _exit()

void _exit ( )
protected

Definition at line 110 of file Skill.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _init()

void _init ( )
protected

Definition at line 56 of file Skill.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _main()

void _main ( )
protected

Definition at line 100 of file Skill.cpp.

+ Here is the caller graph for this function:

◆ checkWhetherSkillShouldStopASAP()

bool checkWhetherSkillShouldStopASAP ( ) const

Definition at line 140 of file Skill.cpp.

◆ executeFullSkill()

Skill::MainResult executeFullSkill ( const MainInput in)

Do init, main, exit together.

Definition at line 186 of file Skill.cpp.

◆ exitSkill()

Skill::ExitResult exitSkill ( const ExitInput in)

Definition at line 121 of file Skill.cpp.

◆ getSkillId()

SkillID getSkillId ( ) const
inline

The id of the skill (combination of provider and name must be unique).

Definition at line 74 of file Skill.h.

+ Here is the caller graph for this function:

◆ initSkill()

Skill::InitResult initSkill ( const InitInput in)

Definition at line 94 of file Skill.cpp.

◆ installConditionWithCallback()

void installConditionWithCallback ( std::function< bool()> &&  f,
std::function< void()> &&  cb 
)
protected

install a condition which is frequently checked from the conditionCheckingThread

Definition at line 15 of file Skill.cpp.

◆ isSkillAvailable()

bool isSkillAvailable ( const InitInput in) const

Definition at line 21 of file Skill.cpp.

+ Here is the call graph for this function:

◆ mainOfSkill()

Skill::MainResult mainOfSkill ( const MainInput in)

Definition at line 104 of file Skill.cpp.

+ Here is the call graph for this function:

◆ notifySkillToStopASAP()

void notifySkillToStopASAP ( )

Definition at line 134 of file Skill.cpp.

◆ notifyTimeoutReached()

void notifyTimeoutReached ( )
protected

Definition at line 128 of file Skill.cpp.

◆ resetSkill()

void resetSkill ( )

Definition at line 32 of file Skill.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ waitForDependenciesOfSkill()

void waitForDependenciesOfSkill ( )

Definition at line 50 of file Skill.cpp.

Field Documentation

◆ callbacks

std::vector<std::pair<std::function<bool()>, std::function<void()> > > callbacks
protected

active conditions. First is condition (bool return func)

Definition at line 161 of file Skill.h.

◆ callbacksMutex

std::mutex callbacksMutex
mutableprotected

Definition at line 162 of file Skill.h.

◆ description

const SkillDescription description

The descripion of the skill, which will be available via the provider/manager.

Definition at line 147 of file Skill.h.

◆ exited

◆ manager

manager::dti::SkillManagerInterfacePrx manager = nullptr

proxy that called the skills. Will be set from provider and is const afterwards

Definition at line 154 of file Skill.h.

◆ providerName

std::string providerName = "INVALID PROVIDER NAME"

the provider that owns this skill. Will be set from provider and is const afterwards

Definition at line 157 of file Skill.h.

◆ running

std::atomic_bool running = false
protected

Use conditions this way.

Definition at line 165 of file Skill.h.

◆ started

running params

Definition at line 150 of file Skill.h.

◆ stopped

std::atomic_bool stopped = false
protected

Definition at line 166 of file Skill.h.

◆ timeoutReached

std::atomic_bool timeoutReached = false
protected

Definition at line 167 of file Skill.h.


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