fawkes::AspectIniFin Class Reference
Fawkes Aspect Initializer/Finalizer. More...
#include <aspect/inifin.h>

Public Member Functions | |
| AspectIniFin (BlackBoard *blackboard, ThreadCollector *collector, Configuration *config, Logger *logger, Clock *clock) | |
| Constructor. | |
| virtual | ~AspectIniFin () |
| Destructor. | |
| virtual void | init (Thread *thread) |
| Initialize thread. | |
| virtual void | finalize (Thread *thread) |
| Finalize thread. | |
| virtual bool | prepare_finalize (Thread *thread) |
| Prepare finalization of a thread. | |
| void | set_fnet_hub (FawkesNetworkHub *fnethub) |
| Set Fawkes Network Hub. | |
| void | set_mainloop_employer (MainLoopEmployer *employer) |
| Set Fawkes MainLoopEmployer. | |
| void | set_logger_employer (LoggerEmployer *employer) |
| Set Fawkes LoggerEmployer. | |
| void | set_blocked_timing_executor (BlockedTimingExecutor *btexec) |
| Set Fawkes BlockedTimingExecutor. | |
| void | set_network_members (NetworkNameResolver *nnresolver, ServicePublisher *service_publisher, ServiceBrowser *service_browser) |
| Set Fawkes Network Hub. | |
| void | set_plugin_manager (PluginManager *manager) |
| Set plugin manager. | |
| virtual bool | thread_started (Thread *thread) throw () |
| Thread started successfully. | |
| virtual bool | thread_init_failed (Thread *thread) throw () |
| Thread initialization failed. | |
Detailed Description
Fawkes Aspect Initializer/Finalizer.Initializes certain thread aspects. All aspects defined in the Fawkes tree are supported and properly initialized such that guarantees are met.
- See also:
- Fawkes Thread Aspects
Definition at line 60 of file inifin.h.
Constructor & Destructor Documentation
| fawkes::AspectIniFin::AspectIniFin | ( | BlackBoard * | blackboard, | |
| ThreadCollector * | collector, | |||
| Configuration * | config, | |||
| Logger * | logger, | |||
| Clock * | clock | |||
| ) |
Constructor.
- Parameters:
-
blackboard BlackBoard collector Thread collector config Configuration logger Logger clock Clock
Definition at line 67 of file inifin.cpp.
| fawkes::AspectIniFin::~AspectIniFin | ( | ) | [virtual] |
Member Function Documentation
| void fawkes::AspectIniFin::finalize | ( | Thread * | thread | ) | [virtual] |
Finalize thread.
- Parameters:
-
thread thread to finalize
Implements fawkes::ThreadFinalizer.
Definition at line 378 of file inifin.cpp.
References fawkes::Exception::append(), fawkes::LoggerAspect::get_logger(), fawkes::TimeSourceAspect::get_timesource(), fawkes::UniquenessConstraint< ResourceType >::remove(), fawkes::Clock::remove_ext_timesource(), fawkes::LoggerEmployer::remove_logger(), fawkes::UniquenessConstraint< ResourceType >::resource(), and fawkes::MainLoopEmployer::set_mainloop_thread().
| void fawkes::AspectIniFin::init | ( | Thread * | thread | ) | [virtual] |
Initialize thread.
- Parameters:
-
thread thread to initialize
Implements fawkes::ThreadInitializer.
Definition at line 175 of file inifin.cpp.
References fawkes::UniquenessConstraint< ResourceType >::add(), fawkes::LoggerEmployer::add_logger(), fawkes::Thread::add_notification_listener(), fawkes::Exception::append(), fawkes::VisionAspect::CONTINUOUS, fawkes::VisionAspect::CYCLIC, fawkes::LoggerAspect::get_logger(), fawkes::TimeSourceAspect::get_timesource(), fawkes::BlackBoardAspect::init_BlackBoardAspect(), fawkes::ClockAspect::init_ClockAspect(), fawkes::ConfigurableAspect::init_ConfigurableAspect(), fawkes::FawkesNetworkAspect::init_FawkesNetworkAspect(), fawkes::LoggingAspect::init_LoggingAspect(), fawkes::MainLoopAspect::init_MainLoopAspect(), fawkes::NetworkAspect::init_NetworkAspect(), fawkes::PluginDirectorAspect::init_PluginDirectorAspect(), fawkes::ThreadProducerAspect::init_ThreadProducerAspect(), fawkes::VisionAspect::init_VisionAspect(), fawkes::Thread::name(), fawkes::Thread::opmode(), fawkes::Thread::OPMODE_CONTINUOUS, fawkes::Thread::OPMODE_WAITFORWAKEUP, fawkes::Clock::register_ext_timesource(), and fawkes::VisionAspect::vision_thread_mode().
| bool fawkes::AspectIniFin::prepare_finalize | ( | Thread * | thread | ) | [virtual] |
Prepare finalization of a thread.
If the finalizer needs to do anything to prepare a maybe following finalize() can do so here. This is also the only place where it proclaim that finalizing the given thread at the given time is unsafe. The finalizer shall NOT call Thread::prepare_finalize().
- Parameters:
-
thread thread to prepare finalization for
- See also:
- Thread::prepare_finalize()
Implements fawkes::ThreadFinalizer.
Definition at line 348 of file inifin.cpp.
References fawkes::Logger::log_error().
| void fawkes::AspectIniFin::set_blocked_timing_executor | ( | BlockedTimingExecutor * | btexec | ) |
Set Fawkes BlockedTimingExecutor.
Use this to set the Fawkes blocked timing executor.
- Parameters:
-
btexec blocked timing executor instance
Definition at line 135 of file inifin.cpp.
Referenced by FawkesMainThread::FawkesMainThread().
| void fawkes::AspectIniFin::set_fnet_hub | ( | FawkesNetworkHub * | fnethub | ) |
Set Fawkes Network Hub.
Use this to set the Fawkes Network Hub. If you do not use the Fawkes Network you do not need to call this function to set a hub. In that case threads that demand the hub will cause an exception to be thrown that the thread cannot be initialized.
- Parameters:
-
fnethub Fawkes Network Hub
Definition at line 101 of file inifin.cpp.
Referenced by FawkesMainThread::FawkesMainThread().
| void fawkes::AspectIniFin::set_logger_employer | ( | LoggerEmployer * | employer | ) |
Set Fawkes LoggerEmployer.
- Parameters:
-
employer logger employer
Definition at line 124 of file inifin.cpp.
Referenced by FawkesMainThread::FawkesMainThread().
| void fawkes::AspectIniFin::set_mainloop_employer | ( | MainLoopEmployer * | employer | ) |
Set Fawkes MainLoopEmployer.
Use this to set the Fawkes main loop employer. The main loop employer is used to set a new main loop of a plugin with the MainLoopAspect. Uniqueness is quaranteed such that only a single main loop exists at any given time.
- Parameters:
-
employer main loop employer
Definition at line 114 of file inifin.cpp.
Referenced by FawkesMainThread::FawkesMainThread().
| void fawkes::AspectIniFin::set_network_members | ( | NetworkNameResolver * | nnresolver, | |
| ServicePublisher * | service_publisher, | |||
| ServiceBrowser * | service_browser | |||
| ) |
Set Fawkes Network Hub.
Use this to initialize the NetworkAspect. If you do not use the Network Aspect you do not need to call this function to set a hub. In that case threads that demand this aspect will cause an exception to be thrown that the thread cannot be initialized.
- Parameters:
-
nnresolver network name resolver service_publisher service publisher service_browser service browser
Definition at line 151 of file inifin.cpp.
Referenced by FawkesMainThread::FawkesMainThread().
| void fawkes::AspectIniFin::set_plugin_manager | ( | PluginManager * | manager | ) |
Set plugin manager.
- Parameters:
-
manager PluginManager instance
Definition at line 165 of file inifin.cpp.
Referenced by FawkesMainThread::FawkesMainThread().
| bool fawkes::AspectIniFin::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:
-
thread thread that you registered for
- Returns:
- true to stay registered for further thread notifications, false to unregister.
Implements fawkes::ThreadNotificationListener.
Definition at line 456 of file inifin.cpp.
| bool fawkes::AspectIniFin::thread_started | ( | Thread * | thread | ) | throw () [virtual] |
Thread started successfully.
This is called by the thread itself when the thread started successfully.
- Parameters:
-
thread thread that started successfully
- Returns:
- true to stay registered for further thread notifications, false to unregister.
Implements fawkes::ThreadNotificationListener.
Definition at line 439 of file inifin.cpp.
The documentation for this class was generated from the following files:
- src/libs/aspect/inifin.h
- src/libs/aspect/inifin.cpp

