Fawkes API Fawkes Development Version
fawkes::SyncPointAspect Class Reference

Thread aspect to acces to SyncPoints Give this aspect to your thread to manage SyncPoints, i.e. More...

#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...
 
virtual void pre_loop (Thread *thread)
 Empty stub for the pre loop function of the loop listener. More...
 
virtual void post_loop (Thread *thread)
 Empty stub for the post loop function of the loop listener. 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 34 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 43 of file syncpoint.cpp.

References fawkes::Aspect::add_aspect().

◆ 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 62 of file syncpoint.cpp.

References fawkes::Aspect::add_aspect().

◆ ~SyncPointAspect()

fawkes::SyncPointAspect::~SyncPointAspect ( )
virtual

Destructor.

Definition at line 75 of file syncpoint.cpp.

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 109 of file syncpoint.cpp.

References fawkes::Thread::name(), fawkes::SyncPointManager::release_syncpoint(), fawkes::Thread::remove_loop_listener(), and fawkes::SyncPoint::unregister_emitter().

Referenced by fawkes::SyncPointAspectIniFin::finalize().

◆ 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 87 of file syncpoint.cpp.

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

Referenced by fawkes::SyncPointAspectIniFin::init().

◆ 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 140 of file syncpoint.cpp.

References fawkes::SyncPoint::emit(), and fawkes::Thread::name().

◆ 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 129 of file syncpoint.cpp.

References fawkes::Thread::name(), and fawkes::SyncPoint::wait().


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