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

#include <AbstractReader.h>

Inherits keyple::core::seproxy::plugin::AbstractSeProxyComponent, and keyple::core::seproxy::message::ProxyReader.

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

Public Member Functions

std::vector< std::shared_ptr< SeResponse > > transmitSeRequests (const std::vector< std::shared_ptr< SeRequest >> &seRequests, const MultiSeRequestProcessing &multiSeRequestProcessing, const ChannelControl &channelControl) override
 
std::shared_ptr< SeResponsetransmitSeRequest (std::shared_ptr< SeRequest > seRequest, const ChannelControl &channelControl) override
 
const std::string & getPluginName () const
 
const std::string & getName () const override
 
- 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::message::ProxyReader
virtual ~ProxyReader ()
 
- Public Member Functions inherited from keyple::core::seproxy::SeReader
virtual ~SeReader ()
 
virtual bool isSePresent ()=0
 
virtual void addSeProtocolSetting (std::shared_ptr< SeProtocol > seProtocol, const std::string &protocolRule)=0
 
virtual void setSeProtocolSetting (const std::map< std::shared_ptr< SeProtocol >, std::string > &protocolSetting)=0
 
virtual const TransmissionModegetTransmissionMode () const =0
 
virtual bool operator== (const SeReader &o) const
 
- Public Member Functions inherited from keyple::core::seproxy::ProxyElement
virtual ~ProxyElement ()=default
 
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)
 

Protected Member Functions

 AbstractReader (const std::string &pluginName, const std::string &name)
 
virtual ~AbstractReader ()=default
 
virtual std::vector< std::shared_ptr< SeResponse > > processSeRequests (const std::vector< std::shared_ptr< SeRequest >> &seRequests, const MultiSeRequestProcessing &multiSeRequestProcessing, const ChannelControl &channelControl)=0
 
virtual std::shared_ptr< SeResponseprocessSeRequest (const std::shared_ptr< SeRequest > seRequest, const ChannelControl &channelControl)=0
 

Protected Attributes

std::shared_ptr< DefaultSelectionsRequestmDefaultSelectionsRequest
 
ObservableReader::NotificationMode mNotificationMode
 

Detailed Description

Abstract definition of an observable reader.

Constructor & Destructor Documentation

◆ AbstractReader()

keyple::core::seproxy::plugin::AbstractReader::AbstractReader ( const std::string &  pluginName,
const std::string &  name 
)
protected

Reader constructor

Force the definition of a name through the use of super method.

Initialize the time measurement

Parameters
pluginNamethe name of the plugin that instantiated the reader
namethe name of the reader

◆ ~AbstractReader()

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

Member Function Documentation

◆ getName()

const std::string& keyple::core::seproxy::plugin::AbstractReader::getName ( ) const
inlineoverridevirtual

C++ vs. Java: have to override the method here to link ProxyElement interface to actual implementation

Implements keyple::core::seproxy::ProxyElement.

Reimplemented in keyple::plugin::pcsc::PcscReaderImpl.

◆ getPluginName()

const std::string & keyple::core::seproxy::plugin::AbstractReader::getPluginName ( ) const

Gets the name of plugin provided in the constructor.

The method will be used particularly for logging purposes. The plugin name is also part of the ReaderEvent and PluginEvent objects.

Returns
the plugin name String

◆ processSeRequest()

virtual std::shared_ptr<SeResponse> keyple::core::seproxy::plugin::AbstractReader::processSeRequest ( const std::shared_ptr< SeRequest seRequest,
const ChannelControl channelControl 
)
protectedpure virtual

Abstract method implemented by the AbstractLocalReader and VirtualReader classes.

This method is handled by transmit.

Parameters
seRequestthe keyple::core::seproxy::message::SeRequest to be processed
channelControla flag indicating if the channel has to be closed after the processing of the keyple::core::seproxy::message::SeRequest
Returns
the keyple::core::seproxy::message::SeResponse (responses to the keyple::core::seproxy::message::SeRequest)
Exceptions
KeypleReaderIOExceptionif the communication with the reader or the SE has failed

Implemented in keyple::core::seproxy::plugin::AbstractLocalReader.

◆ processSeRequests()

virtual std::vector<std::shared_ptr<SeResponse> > keyple::core::seproxy::plugin::AbstractReader::processSeRequests ( const std::vector< std::shared_ptr< SeRequest >> &  seRequests,
const MultiSeRequestProcessing multiSeRequestProcessing,
const ChannelControl channelControl 
)
protectedpure virtual

Abstract method implemented by the AbstractLocalReader and VirtualReader classes.

This method is handled by transmitSet.

Parameters
seRequestsa list of keyple::core::seproxy::message::SeRequest to be processed
multiSeRequestProcessingthe multi se processing mode
channelControlindicates if the channel has to be closed at the end of the processing
Returns
the List of keyple::core::seproxy::message::SeResponse (responses to the Set of keyple::core::seproxy::message::SeRequest)
Exceptions
KeypleReaderIOExceptionif the communication with the reader or the SE has failed

Implemented in keyple::core::seproxy::plugin::AbstractLocalReader.

◆ transmitSeRequest()

std::shared_ptr< SeResponse > keyple::core::seproxy::plugin::AbstractReader::transmitSeRequest ( std::shared_ptr< SeRequest seRequest,
const ChannelControl channelControl 
)
overridevirtual

Execute the transmission of a keyple::core::seproxy::message::SeRequest and returns a keyple::core::seproxy::message::SeResponse

The individual execution time (inter-exchange and communication) and the keyple::core::seproxy::message::SeRequest content is logged (DEBUG level).

As the method is final, it cannot be extended.

Parameters
seRequestthe request to be transmitted
channelControlindicates if the channel has to be closed at the end of the processing
Returns
the received response
Exceptions
KeypleReaderIOExceptionif the communication with the reader or the SE has failed

Implements keyple::core::seproxy::message::ProxyReader.

◆ transmitSeRequests()

std::vector< std::shared_ptr< SeResponse > > keyple::core::seproxy::plugin::AbstractReader::transmitSeRequests ( const std::vector< std::shared_ptr< SeRequest >> &  seRequests,
const MultiSeRequestProcessing multiSeRequestProcessing,
const ChannelControl channelControl 
)
overridevirtual

Execute the transmission of a list of keyple::core::seproxy::message::SeRequest and returns a list of keyple::core::seproxy::message::SeResponse

The keyple::core::seproxy::MultiSeRequestProcessing parameter indicates whether all requests are to be sent regardless of their result (PROCESS_ALL) or whether the process should stop at the first request whose result is a success (FIRST_MATCH).

The keyple::core::seproxy::message::ChannelControl parameter specifies whether the physical channel should be closed (CLOSE_AFTER) or not (KEEP_OPEN) after all requests have been transmitted.

The global execution time (inter-exchange and communication) and the Set of SeRequest content is logged (DEBUG level).

As the method is final, it cannot be extended.

Parameters
seRequeststhe request set
multiSeRequestProcessingthe multi SE request processing mode
channelControlthe channel control indicator
Returns
the response set
Exceptions
KeypleReaderIOExceptionif the communication with the reader or the SE has failed

Implements keyple::core::seproxy::message::ProxyReader.

Member Data Documentation

◆ mDefaultSelectionsRequest

std::shared_ptr<DefaultSelectionsRequest> keyple::core::seproxy::plugin::AbstractReader::mDefaultSelectionsRequest
protected

The default DefaultSelectionsRequest to be executed upon SE insertion

◆ mNotificationMode

ObservableReader::NotificationMode keyple::core::seproxy::plugin::AbstractReader::mNotificationMode
protected

Indicate if all SE detected should be notified or only matching SE


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