Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fawkes::AspectIniFin Class Reference

Aspect initializer/finalizer base class. More...

#include <>>

Inheritance diagram for fawkes::AspectIniFin:

List of all members.

Public Member Functions

 AspectIniFin (const char *aspect_name) __attribute__((nonnull))
 Constructor.
virtual ~AspectIniFin ()
 Virtual empty destructor.
virtual void init (Thread *thread)=0
 Initialize thread.
virtual void finalize (Thread *thread)=0
 Finalize thread.
virtual bool prepare_finalize (Thread *thread)
 Default finalize preparation.
const char * get_aspect_name () const
 Get aspect name.

Detailed Description

Aspect initializer/finalizer base class.

This class must be derived for each aspect that is added to the system, either standard or custom aspects.

Author:
Tim Niemueller

Definition at line 36 of file inifin.h.


Constructor & Destructor Documentation

fawkes::AspectIniFin::AspectIniFin ( const char *  aspect_name)

Constructor.

Parameters:
aspect_namename of the aspect the aspect initializer/finalizer subclass is used for. It must exist for the whole lifetime of the initializer/finalizer.

Definition at line 61 of file inifin.cpp.

fawkes::AspectIniFin::~AspectIniFin ( )
virtual

Virtual empty destructor.

Definition at line 67 of file inifin.cpp.


Member Function Documentation

void fawkes::AspectIniFin::finalize ( Thread thread)
pure 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

Implemented in fawkes::MainLoopAspectIniFin, fawkes::VisionMasterAspectIniFin, fawkes::NetworkAspectIniFin, fawkes::CLIPSAspectIniFin, fawkes::TimeSourceAspectIniFin, fawkes::OpenRaveAspectIniFin, fawkes::RRDAspectIniFin, fawkes::LoggerAspectIniFin, fawkes::AspectProviderAspectIniFin, fawkes::BlackBoardAspectIniFin, fawkes::ClockAspectIniFin, fawkes::ConfigurableAspectIniFin, fawkes::FawkesNetworkAspectIniFin, fawkes::LoggingAspectIniFin, fawkes::PluginDirectorAspectIniFin, fawkes::ThreadProducerAspectIniFin, fawkes::VisionAspectIniFin, fawkes::WebviewAspectIniFin, fawkes::PointCloudAspectIniFin, fawkes::TransformAspectIniFin, fawkes::NaoQiAspectIniFin, fawkes::OpenNiAspectIniFin, fawkes::ROSAspectIniFin, and fawkes::BlockedTimingAspectIniFin.

const char * fawkes::AspectIniFin::get_aspect_name ( ) const

Get aspect name.

Returns:
name of the aspect this initializer/finalizer is used for

Definition at line 88 of file inifin.cpp.

Referenced by fawkes::AspectManager::register_default_inifins(), fawkes::AspectManager::register_inifin(), and fawkes::AspectManager::unregister_inifin().

bool fawkes::AspectIniFin::prepare_finalize ( Thread thread)
virtual

Default finalize preparation.

This is a default implementation that assumes that finalization is always safe. Override it if you need to make more fine-grained decisions.

Parameters:
threadthread to prepare for finalization
Returns:
always true

Reimplemented in fawkes::VisionMasterAspectIniFin, fawkes::AspectProviderAspectIniFin, and fawkes::VisionAspectIniFin.

Definition at line 79 of file inifin.cpp.


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