Keyple C++
0.9.0
Keyple, an Open Source SDK for Ticketing
|
#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< SelectionsResult > | processDefaultSelection (std::shared_ptr< AbstractDefaultSelectionsResponse > defaultSelectionsResponse) |
std::shared_ptr< SelectionsResult > | processExplicitSelection (std::shared_ptr< SeReader > seReader) |
std::shared_ptr< AbstractDefaultSelectionsRequest > | getSelectionOperation () |
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) |
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).
keyple::core::selection::SeSelection::SeSelection | ( | MultiSeRequestProcessing | multiSeRequestProcessing | ) |
Constructor.
multiSeRequestProcessing | the multi se processing mode |
keyple::core::selection::SeSelection::SeSelection | ( | ) |
Alternate constructor for standard usages.
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.
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.
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.
seSelectionRequest | the selector to prepare |
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.
defaultSelectionsResponse | the response from the reader to the keyple::core::seproxy::event::AbstractDefaultSelectionsRequest |
KeypleException | if an error occurs during the selection process |
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:
seReader | the SeReader on which the selection is made |
KeypleReaderIOException | if the communication with the reader or the SE has failed |
KeypleException | if an error occurs during the selection process |
|
friend |
|
friend |
|
friend |