keyple-card-calypso-crypto-legacysam-cpp-lib - 1.0.2
Component of the Keyple C++ middleware
ContextSettingAdapter.cpp
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2023 Calypso Networks Association https://calypsonet.org/ *
3 * *
4 * See the NOTICE file(s) distributed with this work for additional *
5 * information regarding copyright ownership. *
6 * *
7 * This program and the accompanying materials are made available under the *
8 * terms of the Eclipse Public License 2.0 which is available at *
9 * http://www.eclipse.org/legal/epl-2.0 *
10 * *
11 * SPDX-License-Identifier: EPL-2.0 *
12 ******************************************************************************/
13
14#include "keyple/card/calypso/crypto/legacysam/ContextSettingAdapter.hpp"
15
16#include <memory>
17
18#include "keyple/core/util/KeypleAssert.hpp"
19
20namespace keyple {
21namespace card {
22namespace calypso {
23namespace crypto {
24namespace legacysam {
25
26using keyple::core::util::Assert;
27
28ContextSettingAdapter::ContextSettingAdapter()
29: mContactReaderPayloadCapacity(nullptr)
30{
31}
32
33ContextSetting&
34ContextSettingAdapter::setContactReaderPayloadCapacity(int payloadCapacity)
35{
36 Assert::getInstance().isInRange(payloadCapacity, 0, 255, "payloadCapacity");
37
38 mContactReaderPayloadCapacity = std::make_shared<int>(payloadCapacity);
39
40 return *this;
41}
42
43std::shared_ptr<int>
44ContextSettingAdapter::getContactReaderPayloadCapacity() const
45{
46 return mContactReaderPayloadCapacity;
47}
48
49} /* namespace legacysam */
50} /* namespace crypto */
51} /* namespace calypso */
52} /* namespace card */
53} /* namespace keyple */