Fawkes API  Fawkes Development Version
fawkes::MainLoopAspectIniFin Class Reference

Initializer/finalizer for the MainLoopAspect. More...

#include <>>

Inheritance diagram for fawkes::MainLoopAspectIniFin:

List of all members.

Public Member Functions

 MainLoopAspectIniFin (MainLoopEmployer *employer, BlockedTimingExecutor *btexec)
 Constructor.
virtual void init (Thread *thread)
 Initialize thread.
virtual void finalize (Thread *thread)
 Finalize thread.
virtual bool thread_started (Thread *thread) throw ()
 Thread started successfully.
virtual bool thread_init_failed (Thread *thread) throw ()
 Thread initialization failed.

Detailed Description

Initializer/finalizer for the MainLoopAspect.

Author:
Tim Niemueller

Constructor & Destructor Documentation

fawkes::MainLoopAspectIniFin::MainLoopAspectIniFin ( MainLoopEmployer employer,
BlockedTimingExecutor btexec 
)

Constructor.

Parameters:
employermain loop employer to register main loop to
btexecblocked timing executor to pass to thread

Definition at line 44 of file mainloop.cpp.


Member Function Documentation

void fawkes::MainLoopAspectIniFin::finalize ( Thread thread) [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.

Parameters:
threadthread to finalize

Implements fawkes::AspectIniFin.

Definition at line 82 of file mainloop.cpp.

References fawkes::Thread::name(), fawkes::MainLoopEmployer::set_mainloop_thread(), fawkes::UniquenessConstraint::remove(), and fawkes::Exception::append().

void fawkes::MainLoopAspectIniFin::init ( Thread thread) [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.

Parameters:
threadthread to initialize

Implements fawkes::AspectIniFin.

Definition at line 54 of file mainloop.cpp.

References fawkes::Thread::name(), fawkes::Thread::opmode(), fawkes::UniquenessConstraint::add(), fawkes::MainLoopAspect::init_MainLoopAspect(), fawkes::Thread::add_notification_listener(), and fawkes::Exception::append().

bool fawkes::MainLoopAspectIniFin::thread_init_failed ( Thread thread) throw () [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.

Parameters:
threadthread that you registered for
Returns:
true to stay registered for further thread notifications, false to unregister.

Implements fawkes::ThreadNotificationListener.

Definition at line 121 of file mainloop.cpp.

bool fawkes::MainLoopAspectIniFin::thread_started ( Thread thread) throw () [virtual]

Thread started successfully.

This is called by the thread itself when the thread started successfully.

Parameters:
threadthread that started successfully
Returns:
true to stay registered for further thread notifications, false to unregister.

Implements fawkes::ThreadNotificationListener.

Definition at line 104 of file mainloop.cpp.


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