#include <ObservableReader.h>
Inherits keyple::core::seproxy::SeReader.
Inherited by keyple::core::seproxy::plugin::ObservableReaderNotifier [virtual]
, keyple::plugin::pcsc::PcscReader [virtual]
, and keyple::plugin::stub::StubReader [virtual]
.
The ObservableReader interface provides the API for observable readers.
-
Observer management
-
Start/stop of SE detection
-
Managing the default selection
-
Definition of polling and notification modes
◆ PollingMode
Indicates the action to be taken after processing a SE.
Enumerator |
---|
REPEATING | continue waiting for the insertion of a next SE.
|
SINGLESHOT | stop and wait for a restart signal.
|
◆ ~ObservableReader()
virtual keyple::core::seproxy::event::ObservableReader::~ObservableReader |
( |
| ) |
|
|
virtualdefault |
◆ addObserver()
virtual void keyple::core::seproxy::event::ObservableReader::addObserver |
( |
const std::shared_ptr< ReaderObserver > |
observer | ) |
|
|
pure virtual |
Add a reader observer.
The observer will receive all the events produced by this reader (card insertion, removal, etc.)
- Parameters
-
observer | the observer object |
◆ clearObservers()
virtual void keyple::core::seproxy::event::ObservableReader::clearObservers |
( |
| ) |
|
|
pure virtual |
◆ countObservers()
virtual int keyple::core::seproxy::event::ObservableReader::countObservers |
( |
| ) |
const |
|
pure virtual |
◆ finalizeSeProcessing()
virtual void keyple::core::seproxy::event::ObservableReader::finalizeSeProcessing |
( |
| ) |
|
|
pure virtual |
Terminates the processing of the SE, in particular after an interruption by exception
Do nothing if the channel is already closed.
Channel closing is nominally managed by using the CLOSE_AFTER flag during the last transmission with the SE. However, there are cases where exchanges with the SE are interrupted by an exception, in which case it is necessary to explicitly close the channel using this method.
Implemented in keyple::core::seproxy::plugin::AbstractObservableLocalReader.
◆ removeObserver()
virtual void keyple::core::seproxy::event::ObservableReader::removeObserver |
( |
const std::shared_ptr< ReaderObserver > |
observer | ) |
|
|
pure virtual |
Remove a reader observer.
The observer will nolonger receive any of the events produced by this reader.
- Parameters
-
observer | the observer object |
◆ setDefaultSelectionRequest() [1/2]
Defines the selection request to be processed when an SE is inserted. Depending on the SE and the notificationMode parameter, a SE_INSERTED, SE_MATCHED or no event at all will be notified to the application observers.
- Parameters
-
defaultSelectionsRequest | the selection request to be operated |
notificationMode | indicates whether a SE_INSERTED event should be notified even if the selection has failed (ALWAYS) or whether the SE insertion should be ignored in this case (MATCHED_ONLY). |
Implemented in keyple::core::seproxy::plugin::AbstractObservableLocalReader.
◆ setDefaultSelectionRequest() [2/2]
A combination of defining the default selection request and starting the SE detection.
- Parameters
-
defaultSelectionsRequest | the selection request to be operated |
notificationMode | indicates whether a SE_INSERTED event should be notified even if the selection has failed (ALWAYS) or whether the SE insertion should be ignored in this case (MATCHED_ONLY). |
pollingMode | indicates the action to be followed after processing the SE: if CONTINUE, the SE detection is restarted, if STOP, the SE detection is stopped until a new call to startSeDetection is made. |
Implemented in keyple::core::seproxy::plugin::AbstractObservableLocalReader.
◆ startSeDetection()
virtual void keyple::core::seproxy::event::ObservableReader::startSeDetection |
( |
const PollingMode |
pollingMode | ) |
|
|
pure virtual |
Starts the SE detection. Once activated, the application can be notified of the arrival of an SE.
- Parameters
-
pollingMode | indicates the action to be followed after processing the SE: if REPEATING, the SE detection is restarted, if SINGLESHOT, the SE detection is stopped until a new call to startSeDetection is made. |
Implemented in keyple::core::seproxy::plugin::AbstractObservableLocalReader.
◆ stopSeDetection()
virtual void keyple::core::seproxy::event::ObservableReader::stopSeDetection |
( |
| ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: