Fawkes API  Fawkes Development Version
fawkes::AspectProviderAspectIniFin Class Reference

Initializer/finalizer for the AspectProviderAspect. More...

#include <>>

Inheritance diagram for fawkes::AspectProviderAspectIniFin:

Public Member Functions

 AspectProviderAspectIniFin (AspectManager *manager)
 Constructor. More...
 
virtual void init (Thread *thread)
 Initialize thread. More...
 
virtual void finalize (Thread *thread)
 Finalize thread. More...
 
virtual bool prepare_finalize (Thread *thread)
 Default finalize preparation. More...
 
- Public Member Functions inherited from fawkes::AspectIniFin
 AspectIniFin (const char *aspect_name) __attribute__((nonnull))
 Constructor. More...
 
virtual ~AspectIniFin ()
 Virtual empty destructor. More...
 
const char * get_aspect_name () const
 Get aspect name. More...
 

Detailed Description

Initializer/finalizer for the AspectProviderAspect.

This initializer/finalizer will register the AspectIniFin instance with the main aspect manager on init, and unregister it on finalization. it will deny unloading if there are still threads using the provided aspect.

Author
Tim Niemueller

Definition at line 36 of file aspect_provider.h.

Constructor & Destructor Documentation

◆ AspectProviderAspectIniFin()

fawkes::AspectProviderAspectIniFin::AspectProviderAspectIniFin ( AspectManager manager)

Constructor.

Parameters
manageraspect manager to register new aspects to

Definition at line 44 of file aspect_provider.cpp.

Member Function Documentation

◆ finalize()

void fawkes::AspectProviderAspectIniFin::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 93 of file aspect_provider.cpp.

References fawkes::AspectProviderAspect::aspect_provider_aspects(), fawkes::Thread::name(), and fawkes::AspectManager::unregister_inifin().

◆ init()

void fawkes::AspectProviderAspectIniFin::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 52 of file aspect_provider.cpp.

References fawkes::AspectProviderAspect::aspect_provider_aspects(), fawkes::Thread::name(), and fawkes::AspectManager::register_inifin().

◆ prepare_finalize()

bool fawkes::AspectProviderAspectIniFin::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 from fawkes::AspectIniFin.

Definition at line 73 of file aspect_provider.cpp.

References fawkes::AspectProviderAspect::aspect_provider_aspects(), and fawkes::AspectManager::has_threads_for_aspect().


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