Fawkes API
Fawkes Development Version
|
Thread aspect provide a new aspect. More...
#include <>>
Public Member Functions | |
AspectProviderAspect (const char *aspect_name, AspectIniFin *inifin) | |
Constructor. More... | |
virtual | ~AspectProviderAspect () |
Virtual empty destructor. More... | |
const char * | aspect_provider_name () const |
Get name of the provided aspect. More... | |
AspectIniFin * | aspect_provider_inifin () const |
Get initializer/finalizer for the provided aspect. More... | |
![]() | |
const std::list< const char * > & | get_aspects () const |
Get list of aspect names attached to a aspected thread. More... | |
Additional Inherited Members | |
![]() | |
void | add_aspect (const char *name) |
Add an aspect to a thread. More... | |
Thread aspect provide a new aspect.
Aspects in Fawkes are used to provide access to framework features. More generally speaking they are used to provide access to features on the C++ programming level. In some situations, it might be useful to provide a custom aspect to allow for access to a resource on this level, e.g. bypassing the blackboard for communication. In this case the AspectProviderAspect can be used.
Use this rarely! Be absolutely certain, that there is no better or equally good way to implement a feature without a new aspect. If used it allows for a well-defined way to exchange resources between threads (and even plugins). Make sure that you define strong guarantees and keep them by means of your aspect initializer/finalizer. For example if you share a (pointer to a) resource, you must make sure, that this resource stays as long as there is any user!
Definition at line 36 of file aspect_provider.h.
fawkes::AspectProviderAspect::AspectProviderAspect | ( | const char * | aspect_name, |
AspectIniFin * | inifin | ||
) |
Constructor.
This special constructor is needed to define the wakeup point.
aspect_name | Name of the aspect which is provided. The string must exist for the whole lifetime of this AspectProviderAspect instance! |
inifin | intializer/finalizer for the aspect. The inifin must exist for the whole lifetime of this AspectProviderAspect instance! |
Definition at line 59 of file aspect_provider.cpp.
References fawkes::Aspect::add_aspect().
|
virtual |
Virtual empty destructor.
Definition at line 69 of file aspect_provider.cpp.
AspectIniFin * fawkes::AspectProviderAspect::aspect_provider_inifin | ( | ) | const |
Get initializer/finalizer for the provided aspect.
Definition at line 88 of file aspect_provider.cpp.
Referenced by fawkes::AspectProviderAspectIniFin::finalize(), and fawkes::AspectProviderAspectIniFin::init().
const char * fawkes::AspectProviderAspect::aspect_provider_name | ( | ) | const |
Get name of the provided aspect.
Definition at line 78 of file aspect_provider.cpp.
Referenced by fawkes::AspectProviderAspectIniFin::prepare_finalize().