19#include "IllegalStateException.h"
25using namespace keyple::core::util::cpp::exception;
32 mCardCommands.push_back(command);
36 const SvOperation svOperation)
41 mSvOperation = svOperation;
49 if (!mCardCommands.empty()) {
50 throw IllegalStateException(
"This SV command can only be placed in the first position" \
51 " in the list of prepared commands");
55 throw IllegalStateException(
"This SV command must follow an SV Get command");
59 if (svOperation != mSvOperation) {
60 mLogger->error(
"Sv operation = %, current command = %\n", mSvOperation, svOperation);
61 throw IllegalStateException(
"Inconsistent SV operation.");
64 mSvOperationComplete =
true;
66 throw IllegalStateException(
"An SV command is expected.");
69 mSvLastCommand = command->getCommandRef();
71 mCardCommands.push_back(command);
76 mCardCommands.clear();
86 return !mCardCommands.empty();
91 const bool flag = mSvOperationComplete;
92 mSvOperationComplete =
false;
static const CalypsoCardCommand SV_RELOAD
static const CalypsoCardCommand SV_DEBIT
static const CalypsoCardCommand SV_GET
static const CalypsoCardCommand SV_UNDEBIT
bool isSvOperationCompleteOneTime()
void addStoredValueCommand(const std::shared_ptr< AbstractCardCommand > command, const SvOperation svOperation)
const std::vector< std::shared_ptr< AbstractCardCommand > > & getCardCommands() const
void addRegularCommand(const std::shared_ptr< AbstractCardCommand > command)
void notifyCommandsProcessed()