Fawkes Aspect Initializer/Finalizer. More...
#include <>>
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) |
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. |
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.
Definition at line 60 of file inifin.h.
fawkes::AspectIniFin::AspectIniFin | ( | BlackBoard * | blackboard, | |
ThreadCollector * | collector, | |||
Configuration * | config, | |||
Logger * | logger, | |||
Clock * | clock | |||
) |
Constructor.
blackboard | BlackBoard | |
collector | Thread collector | |
config | Configuration | |
logger | Logger | |
clock | Clock |
Definition at line 67 of file inifin.cpp.
fawkes::AspectIniFin::~AspectIniFin | ( | ) | [virtual] |
Destructor.
Definition at line 88 of file inifin.cpp.
void fawkes::AspectIniFin::finalize | ( | Thread * | thread | ) | [virtual] |
Finalize thread.
thread | thread to finalize |
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.
thread | thread to initialize |
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::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::Clock::register_ext_timesource(), and fawkes::VisionAspect::vision_thread_mode().
void fawkes::AspectIniFin::set_blocked_timing_executor | ( | BlockedTimingExecutor * | btexec | ) |
Set Fawkes BlockedTimingExecutor.
Use this to set the Fawkes blocked timing executor.
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.
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.
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.
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.
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.
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.
thread | thread that you registered for |
Implements fawkes::ThreadNotificationListener.
Definition at line 456 of file inifin.cpp.
References fawkes::Thread::name().
bool fawkes::AspectIniFin::thread_started | ( | Thread * | thread | ) | throw () [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 439 of file inifin.cpp.