Fawkes API  Fawkes Development Version
fawkes::SyncPointAspect Class Reference

#include <>>

Inheritance diagram for fawkes::SyncPointAspect:

Public Member Functions

 SyncPointAspect (SyncPoint::WakeupType type_in, std::string identifier_in, std::string identifier_out="")
 Constructor. More...
 
 SyncPointAspect (std::string out_identifier)
 Constructor. More...
 
virtual ~SyncPointAspect ()
 Destructor. More...
 
void init_SyncPointAspect (Thread *thread, SyncPointManager *syncpoint_manager)
 Init SyncPoint aspect. More...
 
void finalize_SyncPointAspect (Thread *thread, SyncPointManager *syncpoint_manager)
 Finalize SyncPoint aspect. More...
 
void pre_loop (Thread *thread)
 Wait for the input syncpoint before loop() More...
 
void post_loop (Thread *thread)
 Emit the output syncpoint after loop() More...
 
- Public Member Functions inherited from fawkes::Aspect
const std::list< const char * > & get_aspects () const
 Get list of aspect names attached to a aspected thread. More...
 
- Public Member Functions inherited from fawkes::ThreadLoopListener
virtual ~ThreadLoopListener ()
 Virtual empty destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::Aspect
void add_aspect (const char *name)
 Add an aspect to a thread. More...
 

Detailed Description

Thread aspect to acces to SyncPoints Give this aspect to your thread to manage SyncPoints, i.e. wait for SyncPoints and emit SyncPoints

Author
Till Hofmann

Definition at line 38 of file syncpoint.h.

Constructor & Destructor Documentation

◆ SyncPointAspect() [1/2]

fawkes::SyncPointAspect::SyncPointAspect ( SyncPoint::WakeupType  type_in,
std::string  identifier_in,
std::string  identifier_out = "" 
)

Constructor.

Use this constructor if there should be an input syncpoint. The input syncpoint will be waited for before every loop.

Parameters
type_intype of the input syncpoint
identifier_inidentifier of the input syncpoint
identifier_outidentifier of the output syncpoint. If this identifier is empty, no output syncpoint will be used.

Definition at line 47 of file syncpoint.cpp.

◆ SyncPointAspect() [2/2]

fawkes::SyncPointAspect::SyncPointAspect ( std::string  identifier_out)

Constructor.

Use this constructor if there should be no input syncpoint, but only an output syncpoint.

Parameters
identifier_outidentifier of the output syncpoint

Definition at line 66 of file syncpoint.cpp.

◆ ~SyncPointAspect()

fawkes::SyncPointAspect::~SyncPointAspect ( )
virtual

Destructor.

Definition at line 79 of file syncpoint.cpp.

References fawkes::SyncPointManager::get_syncpoint(), and fawkes::Thread::name().

Member Function Documentation

◆ finalize_SyncPointAspect()

void fawkes::SyncPointAspect::finalize_SyncPointAspect ( Thread thread,
SyncPointManager manager 
)

Finalize SyncPoint aspect.

This releases all syncpoints and unregisters the thread as loop listener.

Parameters
threadthread which uses this aspect
managerSyncPointManager to use

Definition at line 113 of file syncpoint.cpp.

◆ init_SyncPointAspect()

void fawkes::SyncPointAspect::init_SyncPointAspect ( Thread thread,
SyncPointManager manager 
)

Init SyncPoint aspect.

This initializes the syncpoints and registers the thread as loop listener. Additionally, the thread is registered as emitter for the output syncpoint if an output syncpoint is created.

Parameters
threadthread which uses this aspect
managerSyncPointManager to use

Definition at line 91 of file syncpoint.cpp.

◆ post_loop()

void fawkes::SyncPointAspect::post_loop ( Thread thread)
virtual

Emit the output syncpoint after loop()

Parameters
threadthread which uses this aspect and whose loop() just returned

Reimplemented from fawkes::ThreadLoopListener.

Definition at line 144 of file syncpoint.cpp.

◆ pre_loop()

void fawkes::SyncPointAspect::pre_loop ( Thread thread)
virtual

Wait for the input syncpoint before loop()

Parameters
threadthread which uses this aspect and whose loop() will be called

Reimplemented from fawkes::ThreadLoopListener.

Definition at line 133 of file syncpoint.cpp.


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