Fawkes API
Fawkes Development Version
|
Initializer/finalizer for the MainLoopAspect. More...
#include <>>
Public Member Functions | |
MainLoopAspectIniFin (MainLoopEmployer *employer, BlockedTimingExecutor *btexec) | |
Constructor. More... | |
virtual void | init (Thread *thread) |
Initialize thread. More... | |
virtual void | finalize (Thread *thread) |
Finalize thread. More... | |
virtual bool | thread_started (Thread *thread) throw () |
Thread started successfully. More... | |
virtual bool | thread_init_failed (Thread *thread) throw () |
Thread initialization failed. More... | |
![]() | |
AspectIniFin (const char *aspect_name) __attribute__((nonnull)) | |
Constructor. More... | |
virtual | ~AspectIniFin () |
Virtual empty destructor. More... | |
virtual bool | prepare_finalize (Thread *thread) |
Default finalize preparation. More... | |
const char * | get_aspect_name () const |
Get aspect name. More... | |
![]() | |
virtual | ~ThreadNotificationListener () |
Virtual empty destructor. More... | |
Initializer/finalizer for the MainLoopAspect.
Definition at line 40 of file mainloop.h.
fawkes::MainLoopAspectIniFin::MainLoopAspectIniFin | ( | MainLoopEmployer * | employer, |
BlockedTimingExecutor * | btexec | ||
) |
Constructor.
employer | main loop employer to register main loop to |
btexec | blocked timing executor to pass to thread |
Definition at line 44 of file mainloop.cpp.
|
virtual |
Finalize thread.
The aspect for the given thread must be initialized. Use dynamic_cast to cast the thread into the expected aspect class. An exception must be thrown if this fails. If anything fails during initialization of the aspect an Exception must be thrown. This will not prevent the thread from being removed. Use prepare_finalize() to report problems that should prevent the thread from being unloaded.
thread | thread to finalize |
Implements fawkes::AspectIniFin.
Definition at line 82 of file mainloop.cpp.
References fawkes::Exception::append(), fawkes::Thread::name(), and fawkes::MainLoopEmployer::set_mainloop_thread().
Referenced by thread_init_failed().
|
virtual |
Initialize thread.
The aspect for the given thread must be initialized. Use dynamic_cast to cast the thread into the expected aspect class. An exception must be thrown if this fails. If anything fails during initialization of the aspect an Exception must be thrown.
thread | thread to initialize |
Implements fawkes::AspectIniFin.
Definition at line 54 of file mainloop.cpp.
References fawkes::Thread::add_notification_listener(), fawkes::Exception::append(), fawkes::MainLoopAspect::init_MainLoopAspect(), fawkes::Thread::name(), fawkes::Thread::opmode(), and fawkes::Thread::OPMODE_WAITFORWAKEUP.
|
virtual |
Thread initialization failed.
This method is called by ThreadList if one of the threads in the list failed to initialize. This is not necessarily the thread that you registered the notification for. However, the argument is always the thread that you registered for, no matter which thread in the list failed.
thread | thread that you registered for |
Implements fawkes::ThreadNotificationListener.
Definition at line 121 of file mainloop.cpp.
References finalize().
|
virtual |
Thread started successfully.
This is called by the thread itself when the thread started successfully.
thread | thread that started successfully |
Implements fawkes::ThreadNotificationListener.
Definition at line 104 of file mainloop.cpp.
References fawkes::MainLoopEmployer::set_mainloop_thread().