DUECA/DUSIME
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
dueca::Ticker Class Reference

A clock synchronisation object. More...

#include <Ticker.hxx>

Inheritance diagram for dueca::Ticker:
Inheritance graph
[legend]
Collaboration diagram for dueca::Ticker:
Collaboration graph
[legend]

Public Member Functions

 Ticker ()
 Constructor.
 
bool complete ()
 Completion method,.
 
const chargetTypeName ()
 Type name information.
 
 ~Ticker ()
 Destructor.
 
double getDT ()
 Time step of basic tick.
 
double getTimeGranule ()
 Time value (in seconds) of a unit step in (integer) simulation time.
 
int getBaseIncrement ()
 Stepsize of integer simulation time with each tick.
 
int getCompatibleIncrement ()
 Stepsize of integer simulation time with each tick.
 
TimeTickType getIncrement (double span, bool nonzero=true)
 Return a time step rounded to granules.
 
void dataFromMaster (const TimeTickType &ts, int offset_usecs)
 Input of timing data from a master node.
 
void tickFromMaster (const TimeTickType &ts)
 Input of strong timing data from a master node.
 
bool isSynced ()
 Returns true if synced with the master node.
 
void noImplicitSync ()
 Call this to have the ticker sync with the master node.
 
int64_t getUsecsSinceTick (const TimeTickType &t) const
 Returns the number of microseconds elapsed.
 
int64_t getUsecsSinceTick (const TimeSpec &ts) const
 Returns the number of microseconds elapsed.
 
int getUsecsSinceLastTick (TimeTickType &tick) const
 Returns the number of microseconds since the last tick, and the last tick itself.
 
bool usingRTAI () const
 Returns true if using RTAI.
 
ObjectType getObjectType () const
 The ticker is one of the base components of DUECA.
 
- Public Member Functions inherited from dueca::NamedObject
const std::string getEntity () const
 Returns the "entity" part of the name.
 
const std::string getClass () const
 Returns the "class" part of the name.
 
const std::string getPart () const
 Returns the sub-entity or "part" part of the name.
 
const NameSetgetNameSet () const
 This returns the complete name set.
 
const GlobalIdgetId () const
 This returns the id.
 
- Public Member Functions inherited from dueca::TriggerPuller
const std::string & getTriggerName () const
 Find a name.
 

Static Public Member Functions

static const ParameterTablegetParameterTable ()
 return the parameter table.
 
static Tickersingle ()
 Make sure this class is callable from scheme.
 

Friends

class Environment
 
ostreamoperator<< (ostream &os, const Ticker &t)
 Print to stream, for debugging.
 

Additional Inherited Members

- Protected Types inherited from dueca::TriggerPuller
typedef list< TargetDatatargetlist_type
 Combination of a target, someone to pull if requested, and the index that target needs to identify this puller.
 
- Protected Member Functions inherited from dueca::NamedObject
 NamedObject (const GlobalId &id)
 Reserve for AssociateObject.
 
 NamedObject (const NameSet &ns)
 Normal constructor, protected, because it has no use to create a NamedObject by itself.
 
virtual ~NamedObject ()
 Destructor.
 
- Protected Member Functions inherited from dueca::TriggerPuller
void pull (const DataTimeSpec &ts)
 activate and notify the targets
 
 TriggerPuller (const std::string &name=std::string())
 Constructor.
 
virtual ~TriggerPuller ()
 Destructor.
 
virtual void addTarget (const boost::intrusive_ptr< TriggerTarget > &target, unsigned id)
 Add a target to this puller, only called by TriggerTarget's setTrigger.
 
virtual void removeTarget (const TriggerTarget *target)
 Remove a target from the puller, only called by destructor.
 
virtual void setTriggerName ()
 Update the name, used by ConditionAnd and ConditionOr.
 
- Protected Attributes inherited from dueca::TriggerPuller
targetlist_type targets
 List of targets and indices.
 
std::bitset< MAX_MANAGERSactivitylevels
 Index of activitymanager levels.
 
std::string name
 Name, for debugging purposes.
 

Detailed Description

A clock synchronisation object.

A ticker is a DUECA module that is runs by an ActivityManager. The difference with normal modules is that the Ticker blocks, waiting for a certain time. The main function of a Ticker is as a time-based trigger. One ticker is used in each DUECA node. The ticker also publishes a (local) time information channel for modules interested in more than just triggering.

Constructor & Destructor Documentation

◆ Ticker()

dueca::Ticker::Ticker ( )

Constructor.

This constructor is normally called from the scheme script.

Member Function Documentation

◆ getIncrement()

TimeTickType dueca::Ticker::getIncrement ( double span,
bool nonzero = true )

Return a time step rounded to granules.

Parameters
spanTime step to convert to granules
nonzeroIf true (default), return a minimum of 1 granule.
Returns
Rounded granules in span.

◆ getUsecsSinceTick() [1/2]

int64_t dueca::Ticker::getUsecsSinceTick ( const TimeTickType & t) const

Returns the number of microseconds elapsed.

Calculated since the tick given in ts

◆ getUsecsSinceTick() [2/2]

int64_t dueca::Ticker::getUsecsSinceTick ( const TimeSpec & ts) const
inline

Returns the number of microseconds elapsed.

Calculated since the tick given in ts

◆ single()

static Ticker * dueca::Ticker::single ( )
inlinestatic

Make sure this class is callable from scheme.

Return a pointer to the single ticker that works in this node.

◆ getObjectType()

ObjectType dueca::Ticker::getObjectType ( ) const
inlinevirtual

The ticker is one of the base components of DUECA.

Implements dueca::NamedObject.


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