Fawkes API  Fawkes Development Version
fawkes::AspectIniFin Class Referenceabstract

Aspect initializer/finalizer base class. More...

#include <>>

Inheritance diagram for fawkes::AspectIniFin:

Public Member Functions

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

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 33 of file inifin.h.

Constructor & Destructor Documentation

◆ AspectIniFin()

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 58 of file inifin.cpp.

◆ ~AspectIniFin()

fawkes::AspectIniFin::~AspectIniFin ( )
virtual

Virtual empty destructor.

Definition at line 64 of file inifin.cpp.

Member Function Documentation

◆ finalize()

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::OpenPRSAspectIniFin, fawkes::CLIPSAspectIniFin, fawkes::VisionMasterAspectIniFin, fawkes::CLIPSFeatureAspectIniFin, fawkes::CLIPSManagerAspectIniFin, fawkes::MetricsAspectIniFin, fawkes::OpenPRSManagerAspectIniFin, fawkes::MainLoopAspectIniFin, fawkes::NetworkAspectIniFin, fawkes::ASPAspectIniFin, fawkes::TransformAspectIniFin, fawkes::TimeSourceAspectIniFin, fawkes::GazeboAspectIniFin, fawkes::GossipAspectIniFin, fawkes::OpenRaveAspectIniFin, fawkes::RRDAspectIniFin, fawkes::LoggerAspectIniFin, fawkes::NavGraphAspectIniFin, fawkes::ClingoManagerAspectIniFin, fawkes::MongoDBAspectIniFin, fawkes::AspectProviderAspectIniFin, fawkes::BlackBoardAspectIniFin, fawkes::ClockAspectIniFin, fawkes::ConfigurableAspectIniFin, fawkes::FawkesNetworkAspectIniFin, fawkes::LoggingAspectIniFin, fawkes::PluginDirectorAspectIniFin, fawkes::ThreadProducerAspectIniFin, fawkes::VisionAspectIniFin, fawkes::WebviewAspectIniFin, fawkes::PointCloudAspectIniFin, fawkes::NaoQiAspectIniFin, fawkes::OpenNiAspectIniFin, fawkes::ROSAspectIniFin, fawkes::BlockedTimingAspectIniFin, fawkes::SyncPointAspectIniFin, fawkes::SyncPointManagerAspectIniFin, and fawkes::RobotMemoryIniFin.

◆ get_aspect_name()

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 85 of file inifin.cpp.

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

◆ init()

void fawkes::AspectIniFin::init ( Thread thread)
pure virtual

◆ prepare_finalize()

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::CLIPSFeatureAspectIniFin, fawkes::AspectProviderAspectIniFin, and fawkes::VisionAspectIniFin.

Definition at line 76 of file inifin.cpp.


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