famouso::mw::el::EventLayer< LL > Class Template Reference
The event layer provides the main publish/subscribe functionality. More...
#include <EventLayer.h>
Public Types | |
typedef LL::SNN | SNN |
short network representation of the subject | |
typedef EventLayer | type |
self type | |
Public Member Functions | |
void | init () |
initialize the middleware core | |
void | announce (famouso::mw::api::EventChannel< EventLayer > &ec) |
announce an event channel on all lower layers and register the event channel on a local data structure for publisher | |
void | publish (const famouso::mw::api::EventChannel< EventLayer > &ec, const Event &e) |
publishing within an event channel the given event | |
void | subscribe (famouso::mw::api::EventChannel< EventLayer > &ec) |
subscribe an event channel on all lower layers and register the event channel on a local data structure for subscribers | |
void | unsubscribe (famouso::mw::api::EventChannel< EventLayer > &ec) |
unsubscribe an event channel and deregister the event channel from the local data structure for subscribers | |
void | unannounce (famouso::mw::api::EventChannel< EventLayer > &ec) |
unannounc an event channel and deregister the event channel from the local data structure for publishers | |
void | publish_local (const Event &e) |
publishes an event from an event channel locally to other event channels that have subscribed to the same subject. Thus this method can be seen as the local event channel handler. | |
void | fetch (famouso::mw::nl::DistinctNL *bnl=0) |
Fetches an event from a specific sub network and publishes it locally. | |
Protected Types | |
typedef LL | LowerLayer |
Protected Attributes | |
Queue | Publisher |
data structure for managing publisher event channels | |
Queue | Subscriber |
data structure for managing subscriber event channels |
Detailed Description
template<class LL>
class famouso::mw::el::EventLayer< LL >
The event layer provides the main publish/subscribe functionality.
It has the ability to get different lower layer plugs and supports local as well as remote publishing. Furthermore, it handles all relevant data structure for the management of event channels.
- Template Parameters:
-
LL the lower layer is a configurable component see prerequisites.
- Precondition:
- The type of template parameters can be an famouso::mw::anl:AbstractNetworkLayer or an famouso::mw::nal::NetworkAdapter dependent on the configuration of the middleware stack
Member Typedef Documentation
typedef LL famouso::mw::el::EventLayer< LL >::LowerLayer [protected] |
typedef LL::SNN famouso::mw::el::EventLayer< LL >::SNN |
short network representation of the subject
typedef EventLayer famouso::mw::el::EventLayer< LL >::type |
self type
Member Function Documentation
void famouso::mw::el::EventLayer< LL >::announce | ( | famouso::mw::api::EventChannel< EventLayer< LL > > & | ec | ) | [inline] |
announce an event channel on all lower layers and register the event channel on a local data structure for publisher
- Parameters:
-
[in] ec the publishing event channel that is announced
References Queue::append(), famouso::mw::el::EventLayer< LL >::Publisher, famouso::mw::api::EventChannel< ECH >::snn(), famouso::mw::api::EventChannel< ECH >::subject(), and TRACE_FUNCTION.
void famouso::mw::el::EventLayer< LL >::fetch | ( | famouso::mw::nl::DistinctNL * | bnl = 0 |
) | [inline] |
Fetches an event from a specific sub network and publishes it locally.
- Parameters:
-
[in] bnl the network from where an event fetching was requested.
- Todo:
- The default value of zero describes that we have no fetching request from a lower layer. This is for further enhancements like fetching in a time-triggered system, where we fetch periodically without interrupt support from lower network layer.
References famouso::mw::el::EventLayer< LL >::publish_local(), Chain::select(), famouso::mw::el::EventLayer< LL >::Subscriber, and TRACE_FUNCTION.
void famouso::mw::el::EventLayer< LL >::init | ( | ) | [inline] |
initialize the middleware core
References famouso::util::Delegate< parameter, R >::bind(), and famouso::mw::el::IncommingEventFromNL.
void famouso::mw::el::EventLayer< LL >::publish | ( | const famouso::mw::api::EventChannel< EventLayer< LL > > & | ec, | |
const Event & | e | |||
) | [inline] |
publishing within an event channel the given event
- Parameters:
-
[in] ec the publishing event channel [in] e the event that is published
References famouso::mw::el::EventLayer< LL >::publish_local(), famouso::mw::api::EventChannel< ECH >::snn(), famouso::mw::api::EventChannel< ECH >::subject(), TRACE_FUNCTION, and UID::value().
void famouso::mw::el::EventLayer< LL >::publish_local | ( | const Event & | e | ) | [inline] |
publishes an event from an event channel locally to other event channels that have subscribed to the same subject. Thus this method can be seen as the local event channel handler.
- Parameters:
-
[in] e the event that is published
References Chain::select(), famouso::mw::Event::subject, famouso::mw::el::EventLayer< LL >::Subscriber, and TRACE_FUNCTION.
Referenced by famouso::mw::el::EventLayer< LL >::fetch(), and famouso::mw::el::EventLayer< LL >::publish().
void famouso::mw::el::EventLayer< LL >::subscribe | ( | famouso::mw::api::EventChannel< EventLayer< LL > > & | ec | ) | [inline] |
subscribe an event channel on all lower layers and register the event channel on a local data structure for subscribers
- Parameters:
-
[in] ec the subscribing event channel that is announced
References Queue::append(), famouso::mw::api::EventChannel< ECH >::snn(), famouso::mw::api::EventChannel< ECH >::subject(), famouso::mw::el::EventLayer< LL >::Subscriber, TRACE_FUNCTION, and UID::value().
void famouso::mw::el::EventLayer< LL >::unannounce | ( | famouso::mw::api::EventChannel< EventLayer< LL > > & | ec | ) | [inline] |
unannounc an event channel and deregister the event channel from the local data structure for publishers
- Parameters:
-
[in] ec the unsubscribed event channel
References famouso::mw::el::EventLayer< LL >::Publisher, Queue::remove(), and TRACE_FUNCTION.
void famouso::mw::el::EventLayer< LL >::unsubscribe | ( | famouso::mw::api::EventChannel< EventLayer< LL > > & | ec | ) | [inline] |
unsubscribe an event channel and deregister the event channel from the local data structure for subscribers
- Parameters:
-
[in] ec the unsubscribed event channel
References Queue::remove(), famouso::mw::el::EventLayer< LL >::Subscriber, and TRACE_FUNCTION.
Field Documentation
Queue famouso::mw::el::EventLayer< LL >::Publisher [protected] |
data structure for managing publisher event channels
Referenced by famouso::mw::el::EventLayer< LL >::announce(), and famouso::mw::el::EventLayer< LL >::unannounce().
Queue famouso::mw::el::EventLayer< LL >::Subscriber [protected] |
data structure for managing subscriber event channels
Referenced by famouso::mw::el::EventLayer< LL >::fetch(), famouso::mw::el::EventLayer< LL >::publish_local(), famouso::mw::el::EventLayer< LL >::subscribe(), and famouso::mw::el::EventLayer< LL >::unsubscribe().
The documentation for this class was generated from the following file:
- include/mw/el/EventLayer.h