Keyple C++
0.9.0
Keyple, an Open Source SDK for Ticketing
|
#include <AbstractThreadedObservablePlugin.h>
Inherits keyple::core::seproxy::plugin::AbstractObservablePlugin.
Inherited by keyple::plugin::pcsc::PcscPluginImpl [virtual]
, and keyple::plugin::stub::StubPluginImpl.
Public Member Functions | |
void | addObserver (const std::shared_ptr< ObservablePlugin::PluginObserver > observer) final |
void | removeObserver (const std::shared_ptr< ObservablePlugin::PluginObserver > observer) final |
void | clearObservers () final |
virtual | ~AbstractThreadedObservablePlugin () |
![]() | |
virtual int | countObservers () const final |
virtual void | notifyObservers (const std::shared_ptr< PluginEvent > event) final |
![]() | |
virtual ConcurrentMap< const std::string, std::shared_ptr< SeReader > > & | getReaders () override |
virtual const std::set< std::string > | getReaderNames () const override |
const std::shared_ptr< SeReader > | getReader (const std::string &name) final |
const std::string & | getName () const |
![]() | |
AbstractSeProxyComponent (const std::string &name) | |
virtual | ~AbstractSeProxyComponent ()=default |
const std::string & | getName () const |
void | setParameters (const std::map< const std::string, const std::string > ¶meters) |
virtual void | setParameter (const std::string &key, const std::string &value)=0 |
![]() | |
virtual | ~ReaderPlugin ()=default |
![]() | |
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 > ¶meters) |
![]() | |
virtual | ~ObservablePluginNotifier ()=default |
![]() | |
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 | |
AbstractThreadedObservablePlugin (const std::string &name) | |
virtual const std::set< std::string > & | fetchNativeReadersNames ()=0 |
virtual std::shared_ptr< SeReader > | fetchNativeReader (const std::string &name)=0 |
bool | isMonitoring () |
![]() | |
AbstractObservablePlugin (const std::string &name) | |
virtual | ~AbstractObservablePlugin ()=default |
![]() | |
AbstractPlugin (const std::string &name) | |
virtual | ~AbstractPlugin ()=default |
virtual ConcurrentMap< const std::string, std::shared_ptr< SeReader > > & | initNativeReaders ()=0 |
Protected Attributes | |
long long | mThreadWaitTimeout = SETTING_THREAD_TIMEOUT_DEFAULT |
![]() | |
ConcurrentMap< const std::string, std::shared_ptr< SeReader > > | mNativeReaders |
The AbstractThreadedObservablePlugin class provides the means to observe a plugin (insertion/removal of readers) using a monitoring thread.
|
virtual |
|
explicitprotected |
Instantiates an threaded observable plugin
name | name of the plugin |
KeypleReaderNotFoundException | if the reader was not found by its name |
KeypleReaderIOException | if the communication with the reader or the SE has failed |
|
finalvirtual |
Add a plugin observer.
Overrides the method defined in AbstractObservablePlugin, a thread is created if it does not already exist (when the first observer is added).
observer | the observer object |
Reimplemented from keyple::core::seproxy::plugin::AbstractObservablePlugin.
|
finalvirtual |
Remove all observers at once
Overrides the method defined in AbstractObservablePlugin, the thread is ended.
Reimplemented from keyple::core::seproxy::plugin::AbstractObservablePlugin.
|
protectedpure virtual |
Fetch connected native reader (from third party library) by its name Returns the current keyple::core::seproxy::plugin::AbstractReader if it is already listed. Creates and returns a new keyple::core::seproxy::plugin::AbstractReader if not.
name | the reader name |
KeypleReaderNotFoundException | if the reader was not found by its name |
KeypleReaderIOException | if the communication with the reader or the SE has failed |
Implemented in keyple::plugin::stub::StubPluginImpl, and keyple::plugin::pcsc::PcscPluginImpl.
|
protectedpure virtual |
Fetch the list of connected native reader (usually from third party library) and returns their names (or id)
KeypleReaderIOException | if the communication with the reader or the SE has failed |
Implemented in keyple::plugin::stub::StubPluginImpl, and keyple::plugin::pcsc::PcscPluginImpl.
|
protected |
Check weither the background job is monitoring for new readers
|
finalvirtual |
Remove a plugin observer.
Overrides the method defined in AbstractObservablePlugin, the monitoring thread is ended when the last observer is removed.
observer | the observer object |
Reimplemented from keyple::core::seproxy::plugin::AbstractObservablePlugin.
|
protected |
Thread wait timeout in ms
This timeout value will determined the latency to detect changes