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

Time warp for a triggering device. More...

#include <TimeWarp.hxx>

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

Public Member Functions

 TimeWarp (TriggerPuller &base, int warp=0)
 Constructor.
 
virtual ~TimeWarp ()
 Destructor.
 
void warpTime (int w2)
 Change the warp time.
 
virtual const std::string & getTargetName () const override
 Targets are usually "living" objects.
 
- Public Member Functions inherited from dueca::TargetAndPuller
void addTerm (TriggerPuller &p)
 Add another puller to this (and, or) combination of triggers.
 
void addTerm (const boost::intrusive_ptr< TargetAndPuller > &p)
 Add another puller to this combination.
 
bool removeTerm (TriggerPuller &p)
 Remove a term from this TriggerAnd or TriggerOr object.
 
- Public Member Functions inherited from dueca::TriggerPuller
const std::string & getTriggerName () const
 Find a name.
 

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::TargetAndPuller
 TargetAndPuller (const std::string &name=std::string())
 Constructor.
 
virtual ~TargetAndPuller ()
 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.
 
- Protected Attributes inherited from dueca::TargetAndPuller
unsigned name_psize
 Number of pullers when name calculated.
 
- 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

Time warp for a triggering device.

Say that you want to calculate your turbulence/wind field or whatever property that does not rely on input ahead of time. You could trigger on the ticker with a time warp:

// make a 'permanent' time warp (element of your class, or with
// 'new'
my_activity.setTrigger(*tw);
This is a "light weight object" that enables you to read the latest set of data on a StreamChannelEnd...
Definition StreamReaderLatest.hxx:43
static Ticker * single()
Make sure this class is callable from scheme.
Definition Ticker.hxx:277
Time warp for a triggering device.
Definition TimeWarp.hxx:51

Now at – say – step 100-101, your activity gets triggered for 120-121, for a logical time that comes later (in the future) than the actual time of triggering. For negative warps the thing works the other way around.

Be careful when doing this with channels. If you timewarp into the (logical) future, the channel will not yet be filled with data from the time span you are referring to, and if you warp too much into the past, a stream channel may have run out of data.

Constructor & Destructor Documentation

◆ TimeWarp()

dueca::TimeWarp::TimeWarp ( TriggerPuller & base,
int warp = 0 )

Constructor.

Parameters
baseTrigger pulling object whose triggering is to be warped
warpWarp time, the time added to the triggering time specification. Positive means it becomes "logically" later, negative means it becomes locigally earlier.

Member Function Documentation

◆ getTargetName()

virtual const std::string & dueca::TimeWarp::getTargetName ( ) const
overridevirtual

Targets are usually "living" objects.

To find them, use getName()


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