: m_callback(callback), m_userData(userData) {
}
+ResponseCallback::ResponseCallback(ResponseCallback &&other)
+ : m_callback(other.m_callback), m_userData(other.m_userData) {
+ other.m_callback = nullptr;
+ other.m_userData = nullptr;
+}
+
void ResponseCallback::onAnswer(cynara_check_id checkId, int response) const {
if (!m_callback)
return;
public:
ResponseCallback(cynara_response_callback callback, void *userData);
ResponseCallback(const ResponseCallback&) = default;
+ ResponseCallback(ResponseCallback &&other);
~ResponseCallback() {};
void onAnswer(cynara_check_id checkId, int response) const;
public:
CheckData(const PolicyKey &key, const std::string &session, const ResponseCallback &callback)
: m_key(key), m_session(session), m_callback(callback), m_cancelled(false) {}
+ CheckData(CheckData &&other)
+ : m_key(std::move(other.m_key)), m_session(std::move(other.m_session)),
+ m_callback(std::move(other.m_callback)), m_cancelled(other.m_cancelled) {
+ other.m_cancelled = false;
+ }
~CheckData() {}
const PolicyKey &key(void) const {
}
int result = m_cache->update(it->second.session(), it->second.key(),
checkResponse->m_resultRef);
- if (!it->second.cancelled())
- it->second.callback().onAnswer(static_cast<cynara_check_id>(it->first), result);
+ CheckData checkData(std::move(it->second));
m_sequenceContainer.release(it->first);
m_checks.erase(it);
+ if (!checkData.cancelled())
+ checkData.callback().onAnswer(
+ static_cast<cynara_check_id>(checkResponse->sequenceNumber()), result);
}
void Logic::processCancelResponse(CancelResponsePtr cancelResponse) {
friend class PolicyKey;
public:
+ PolicyKeyFeature(const PolicyKeyFeature &) = default;
+ PolicyKeyFeature(PolicyKeyFeature &&) = default;
+
typedef std::string ValueType;
static PolicyKeyFeature create(ValueType value) {
const PolicyKeyFeature::ValueType &privilegeId)
: m_client(clientId), m_user(userId), m_privilege(privilegeId) {};
+ PolicyKey(const PolicyKey &) = default;
+ PolicyKey(PolicyKey &&) = default;
+
bool operator==(const PolicyKey &other) const {
return std::tie(m_client, m_user, m_privilege)
== std::tie(other.m_client, other.m_user, other.m_privilege);