Public Member Functions | Private Types | Private Attributes | List of all members
RTT::scripting::ConditionDuration Class Reference

#include <ConditionDuration.hpp>

Inheritance diagram for RTT::scripting::ConditionDuration:
Inheritance graph
[legend]

Public Member Functions

ConditionInterfaceclone () const
 
 ConditionDuration (nsecs t, bool invert=false)
 
virtual bool evaluate ()
 Evaluate the Condition and return the outcome. More...
 
virtual void reset ()
 
virtual ~ConditionDuration ()
 
- Public Member Functions inherited from RTT::scripting::ConditionInterface
virtual ConditionInterfacecopy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &alreadyCloned) const
 
virtual ~ConditionInterface ()
 

Private Types

typedef os::TimeService::nsecs nsecs
 
typedef os::TimeService::ticks ticks
 

Private Attributes

bool _invert
 
os::TimeServicehb
 
ticks mark
 
nsecs time
 

Detailed Description

A conditional that evaluates true after a certain time has passed. The behaviour can be inverted upon construction.

Definition at line 54 of file ConditionDuration.hpp.

Member Typedef Documentation

Definition at line 57 of file ConditionDuration.hpp.

Definition at line 58 of file ConditionDuration.hpp.

Constructor & Destructor Documentation

RTT::ConditionDuration::ConditionDuration ( nsecs  t,
bool  invert = false 
)

Create a condition that changes after t nano seconds

Parameters
tthe period of time starting from reset()
invertIf false (default) then the condition will raise to true after t. If true then the condition will fall to false after t.

Definition at line 47 of file ConditionDuration.cpp.

RTT::ConditionDuration::~ConditionDuration ( )
virtual

Definition at line 52 of file ConditionDuration.cpp.

Member Function Documentation

ConditionInterface * RTT::ConditionDuration::clone ( ) const
virtual

The Clone Software Pattern.

Implements RTT::scripting::ConditionInterface.

Definition at line 65 of file ConditionDuration.cpp.

bool RTT::ConditionDuration::evaluate ( )
virtual

Evaluate the Condition and return the outcome.

Returns
true if the condition is satisfied, false otherwise.

Implements RTT::scripting::ConditionInterface.

Definition at line 55 of file ConditionDuration.cpp.

void RTT::ConditionDuration::reset ( )
virtual

Some conditions need to be reset at some points. E.g. a scripting::ConditionDuration counts the time since the first time a Command was executed, and if this time exceeds a certain preset time, returns true. Therefore, it needs to be reset, i.e. it needs to start counting, when the command is first executed.. scripting::ConditionOnce has a similar need. This function is called at such times.

Reimplemented from RTT::scripting::ConditionInterface.

Definition at line 60 of file ConditionDuration.cpp.

Member Data Documentation

bool RTT::scripting::ConditionDuration::_invert
private

Invert the time comparison to 'smaller then'

Definition at line 96 of file ConditionDuration.hpp.

os::TimeService* RTT::scripting::ConditionDuration::hb
private

A local reference to the HeartBeat Generator

Definition at line 87 of file ConditionDuration.hpp.

ticks RTT::scripting::ConditionDuration::mark
private

The time the evaluation is called the first time

Definition at line 91 of file ConditionDuration.hpp.

nsecs RTT::scripting::ConditionDuration::time
private

The expiration time, expressed in ticks

Definition at line 83 of file ConditionDuration.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:47