Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Public Member Functions | Protected Member Functions | List of all members
keyple::core::seproxy::plugin::AbstractObservablePlugin Class Reference

#include <AbstractObservablePlugin.h>

Inherits keyple::core::seproxy::plugin::AbstractPlugin, and keyple::core::seproxy::plugin::ObservablePluginNotifier.

Inherited by keyple::core::seproxy::plugin::AbstractThreadedObservablePlugin.

Public Member Functions

virtual void addObserver (const std::shared_ptr< ObservablePlugin::PluginObserver > observer) override
 
virtual void removeObserver (const std::shared_ptr< ObservablePlugin::PluginObserver > observer) override
 
virtual void clearObservers () override
 
virtual int countObservers () const final
 
virtual void notifyObservers (const std::shared_ptr< PluginEvent > event) final
 
- Public Member Functions inherited from keyple::core::seproxy::plugin::AbstractPlugin
virtual ConcurrentMap< const std::string, std::shared_ptr< SeReader > > & getReaders () override
 
virtual const std::set< std::string > getReaderNames () const override
 
const std::shared_ptr< SeReadergetReader (const std::string &name) final
 
const std::string & getName () const
 
- Public Member Functions inherited from keyple::core::seproxy::plugin::AbstractSeProxyComponent
 AbstractSeProxyComponent (const std::string &name)
 
virtual ~AbstractSeProxyComponent ()=default
 
const std::string & getName () const
 
void setParameters (const std::map< const std::string, const std::string > &parameters)
 
virtual void setParameter (const std::string &key, const std::string &value)=0
 
- Public Member Functions inherited from keyple::core::seproxy::ReaderPlugin
virtual ~ReaderPlugin ()=default
 
- Public Member Functions inherited from keyple::core::seproxy::ProxyElement
virtual ~ProxyElement ()=default
 
virtual const std::string & getName () const =0
 
virtual const std::map< const std::string, const std::string > & getParameters () const =0
 
virtual void setParameter (const std::string &key, const std::string &value)=0
 
virtual void setParameters (const std::map< const std::string, const std::string > &parameters)
 
- Public Member Functions inherited from keyple::core::seproxy::plugin::ObservablePluginNotifier
virtual ~ObservablePluginNotifier ()=default
 
- Public Member Functions inherited from keyple::core::seproxy::event::ObservablePlugin
virtual ~ObservablePlugin ()=default
 
virtual void addObserver (const std::shared_ptr< PluginObserver > observer)=0
 
virtual void removeObserver (const std::shared_ptr< PluginObserver > observer)=0
 

Protected Member Functions

 AbstractObservablePlugin (const std::string &name)
 
virtual ~AbstractObservablePlugin ()=default
 
- Protected Member Functions inherited from keyple::core::seproxy::plugin::AbstractPlugin
 AbstractPlugin (const std::string &name)
 
virtual ~AbstractPlugin ()=default
 
virtual ConcurrentMap< const std::string, std::shared_ptr< SeReader > > & initNativeReaders ()=0
 

Additional Inherited Members

- Protected Attributes inherited from keyple::core::seproxy::plugin::AbstractPlugin
ConcurrentMap< const std::string, std::shared_ptr< SeReader > > mNativeReaders
 

Detailed Description

The AbstractObservablePlugin class provides the means to observe a plugin (insertion/removal of readers).

Constructor & Destructor Documentation

◆ AbstractObservablePlugin()

keyple::core::seproxy::plugin::AbstractObservablePlugin::AbstractObservablePlugin ( const std::string &  name)
explicitprotected

Instantiates a observable plugin.

Parameters
namename of the plugin
Exceptions
KeypleReaderExceptionwhen an issue is raised with reader

◆ ~AbstractObservablePlugin()

virtual keyple::core::seproxy::plugin::AbstractObservablePlugin::~AbstractObservablePlugin ( )
protectedvirtualdefault

Member Function Documentation

◆ addObserver()

void keyple::core::seproxy::plugin::AbstractObservablePlugin::addObserver ( const std::shared_ptr< ObservablePlugin::PluginObserver observer)
overridevirtual

Add a plugin observer.

The observer will receive all the events produced by this plugin (reader insertion, removal, etc.)

Parameters
observerthe observer object

Reimplemented in keyple::core::seproxy::plugin::AbstractThreadedObservablePlugin.

◆ clearObservers()

void keyple::core::seproxy::plugin::AbstractObservablePlugin::clearObservers ( )
overridevirtual

◆ countObservers()

int keyple::core::seproxy::plugin::AbstractObservablePlugin::countObservers ( ) const
finalvirtual
Returns
the number of observers

Implements keyple::core::seproxy::event::ObservablePlugin.

◆ notifyObservers()

void keyple::core::seproxy::plugin::AbstractObservablePlugin::notifyObservers ( const std::shared_ptr< PluginEvent event)
finalvirtual

This method shall be called only from a SE Proxy plugin implementing AbstractPlugin. Push a PluginEvent of the selected AbstractPlugin to its registered Observer.

Parameters
eventthe event

Implements keyple::core::seproxy::plugin::ObservablePluginNotifier.

◆ removeObserver()

void keyple::core::seproxy::plugin::AbstractObservablePlugin::removeObserver ( const std::shared_ptr< ObservablePlugin::PluginObserver observer)
overridevirtual

Remove a plugin observer.

The observer will do not receive any of the events produced by this plugin.

Parameters
observerthe observer object

Reimplemented in keyple::core::seproxy::plugin::AbstractThreadedObservablePlugin.


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