Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Public Member Functions | Friends | List of all members
keyple::core::selection::SeSelection Class Referencefinal

#include <SeSelection.h>

Inherits enable_shared_from_this< SeSelection >.

Public Member Functions

 SeSelection (MultiSeRequestProcessing multiSeRequestProcessing)
 
 SeSelection ()
 
int prepareSelection (std::shared_ptr< AbstractSeSelectionRequest< AbstractApduCommandBuilder >> seSelectionRequest)
 
void prepareReleaseSeChannel ()
 
std::shared_ptr< SelectionsResultprocessDefaultSelection (std::shared_ptr< AbstractDefaultSelectionsResponse > defaultSelectionsResponse)
 
std::shared_ptr< SelectionsResultprocessExplicitSelection (std::shared_ptr< SeReader > seReader)
 
std::shared_ptr< AbstractDefaultSelectionsRequestgetSelectionOperation ()
 

Friends

KEYPLECORE_API std::ostream & operator<< (std::ostream &os, const SeSelection &ss)
 
KEYPLECORE_API std::ostream & operator<< (std::ostream &os, const std::unique_ptr< SeSelection > &ss)
 
KEYPLECORE_API std::ostream & operator<< (std::ostream &os, const std::shared_ptr< SeSelection > &ss)
 

Detailed Description

The SeSelection class handles the SE selection process.

It provides a way to do explicit SE selection or to post process a default SE selection.
The channel is kept open by default, but can be closed after each selection cases (see PrepareReleaseSeChannel).

Constructor & Destructor Documentation

◆ SeSelection() [1/2]

keyple::core::selection::SeSelection::SeSelection ( MultiSeRequestProcessing  multiSeRequestProcessing)

Constructor.

Parameters
multiSeRequestProcessingthe multi se processing mode

◆ SeSelection() [2/2]

keyple::core::selection::SeSelection::SeSelection ( )

Alternate constructor for standard usages.

Member Function Documentation

◆ getSelectionOperation()

std::shared_ptr< AbstractDefaultSelectionsRequest > keyple::core::selection::SeSelection::getSelectionOperation ( )

The SelectionOperation is the keyple::core::seproxy::event::AbstractDefaultSelectionsRequest to process in ordered to select a SE among others through the selection process. This method is useful to build the prepared selection to be executed by a reader just after a SE insertion.

Returns
the keyple::core::seproxy::event::AbstractDefaultSelectionsRequest previously prepared with prepareSelection

◆ prepareReleaseSeChannel()

void keyple::core::selection::SeSelection::prepareReleaseSeChannel ( )

Prepare to close the SE channel.
If this command is called before a "process" selection command then the last transmission to the PO will be associated with the indication CLOSE_AFTER in order to close the SE channel.
This makes it possible to chain several selections on the same SE if necessary.

◆ prepareSelection()

int keyple::core::selection::SeSelection::prepareSelection ( std::shared_ptr< AbstractSeSelectionRequest< AbstractApduCommandBuilder >>  seSelectionRequest)

Prepare a selection: add the selection request from the provided selector to the selection request set.

Parameters
seSelectionRequestthe selector to prepare
Returns
the selection index giving the current selection position in the selection request.

◆ processDefaultSelection()

std::shared_ptr< SelectionsResult > keyple::core::selection::SeSelection::processDefaultSelection ( std::shared_ptr< AbstractDefaultSelectionsResponse defaultSelectionsResponse)

Parses the response to a selection operation sent to a SE and return a list of keyple::core::selection::AbstractMatchingSe

Selection cases that have not matched the current SE are set to null.

Parameters
defaultSelectionsResponsethe response from the reader to the keyple::core::seproxy::event::AbstractDefaultSelectionsRequest
Returns
the keyple::core::selection::SelectionsResult containing the result of all prepared selection cases, including keyple::core::selection::AbstractMatchingSe and keyple::core::seproxy::message::SeResponse.
Exceptions
KeypleExceptionif an error occurs during the selection process

◆ processExplicitSelection()

std::shared_ptr< SelectionsResult > keyple::core::selection::SeSelection::processExplicitSelection ( std::shared_ptr< SeReader seReader)

Execute the selection process and return a list of keyple::core::selection::AbstractMatchingSe.

Selection requests are transmitted to the SE through the supplied SeReader.

The process stops in the following cases:

  • All the selection requests have been transmitted
  • A selection request matches the current SE and the keepChannelOpen flag was true
Parameters
seReaderthe SeReader on which the selection is made
Returns
the keyple::core::selection::SelectionsResult containing the result of all prepared selection cases, including keyple::core::selection::AbstractMatchingSe and keyple::core::seproxy::message::SeResponse.
Exceptions
KeypleReaderIOExceptionif the communication with the reader or the SE has failed
KeypleExceptionif an error occurs during the selection process

Friends And Related Function Documentation

◆ operator<< [1/3]

KEYPLECORE_API std::ostream& operator<< ( std::ostream &  os,
const SeSelection ss 
)
friend

◆ operator<< [2/3]

KEYPLECORE_API std::ostream& operator<< ( std::ostream &  os,
const std::shared_ptr< SeSelection > &  ss 
)
friend

◆ operator<< [3/3]

KEYPLECORE_API std::ostream& operator<< ( std::ostream &  os,
const std::unique_ptr< SeSelection > &  ss 
)
friend

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