19#include "CardApiProperties.h"
22#include "ReaderApiProperties.h"
29#include "CommonApiProperties.h"
32#include "KeypleAssert.h"
38using namespace calypsonet::terminal::calypso;
39using namespace calypsonet::terminal::card;
40using namespace calypsonet::terminal::reader;
41using namespace keyple::core::common;
42using namespace keyple::core::util;
45std::shared_ptr<CalypsoExtensionService> CalypsoExtensionService::mInstance;
47CalypsoExtensionService::CalypsoExtensionService() {}
51 if (mInstance ==
nullptr) {
60 return ReaderApiProperties_VERSION;
65 return CardApiProperties_VERSION;
70 return CommonApiProperties_VERSION;
75 return std::make_shared<SearchCommandDataAdapter>();
80 return std::make_shared<CalypsoCardSelectionAdapter>();
85 return std::make_shared<CalypsoSamSelectionAdapter>();
88std::shared_ptr<CardResourceProfileExtension>
90 const std::shared_ptr<CalypsoSamSelection> calypsoSamSelection)
const
92 Assert::getInstance().notNull(calypsoSamSelection,
"calypsoSamSelection");
94 return std::make_shared<CalypsoSamResourceProfileExtensionAdapter>(calypsoSamSelection);
99 return std::make_shared<CardSecuritySettingAdapter>();
103 std::shared_ptr<CardReader> reader,
104 const std::shared_ptr<CalypsoCard> calypsoCard,
105 const std::shared_ptr<CardSecuritySetting> cardSecuritySetting)
108 Assert::getInstance().notNull(reader,
"reader")
109 .notNull(calypsoCard,
"calypsoCard")
110 .notNull(cardSecuritySetting,
"cardSecuritySetting");
116 Assert::getInstance().isTrue(calypsoCard->getProductType() != CalypsoCard::ProductType::UNKNOWN,
119 return std::make_shared<CardTransactionManagerAdapter>(reader,
121 cardSecuritySetting);
124std::shared_ptr<CardTransactionManager>
126 std::shared_ptr<CardReader> reader,
const std::shared_ptr<CalypsoCard> calypsoCard)
128 Assert::getInstance().notNull(reader,
"reader")
129 .notNull(calypsoCard,
"calypsoCard");
135 Assert::getInstance().isTrue(calypsoCard->getProductType() != CalypsoCard::ProductType::UNKNOWN,
138 return std::make_shared<CardTransactionManagerAdapter>(reader, calypsoCard);
std::shared_ptr< CalypsoSamSelection > createSamSelection() const
std::shared_ptr< CardTransactionManager > createCardTransactionWithoutSecurity(std::shared_ptr< CardReader > reader, const std::shared_ptr< CalypsoCard > calypsoCard)
std::shared_ptr< CardResourceProfileExtension > createSamResourceProfileExtension(const std::shared_ptr< CalypsoSamSelection > calypsoSamSelection) const
const std::string & getReaderApiVersion() const override
std::shared_ptr< CardTransactionManager > createCardTransaction(std::shared_ptr< CardReader > reader, const std::shared_ptr< CalypsoCard > calypsoCard, const std::shared_ptr< CardSecuritySetting > cardSecuritySetting)
std::shared_ptr< CardSecuritySetting > createCardSecuritySetting() const
const std::string & getCardApiVersion() const override
static const std::string PRODUCT_TYPE
std::shared_ptr< SearchCommandData > createSearchCommandData() const
const std::string & getCommonApiVersion() const override
std::shared_ptr< CalypsoCardSelection > createCardSelection() const
static std::shared_ptr< CalypsoExtensionService > getInstance()