From: Adam Malinowski Date: Mon, 3 Nov 2014 10:16:22 +0000 (+0100) Subject: Add CheckContext class X-Git-Tag: submit/R4/20141115.054144~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e67f20e8674202893ccfa0f7332acd6a567c404a;p=platform%2Fcore%2Fsecurity%2Fcynara.git Add CheckContext class This class will be used for storing all data related to check request. This data will be used to send response to client when answer is ready. Change-Id: I20b665409e15d249a9c55615a39f4ab5b361bc18 --- diff --git a/src/service/request/CheckContext.h b/src/service/request/CheckContext.h new file mode 100644 index 0000000..5184296 --- /dev/null +++ b/src/service/request/CheckContext.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file src/service/request/CheckContext.h + * @author Adam Malinowski + * @version 1.0 + * @brief Declaration of CheckContext class + */ + +#ifndef SRC_SERVICE_REQUEST_CHECKCONTEXT_H_ +#define SRC_SERVICE_REQUEST_CHECKCONTEXT_H_ + +#include + +#include +#include +#include +#include + +#include + +#include + +namespace Cynara { + +class CheckContext { +public: + CheckContext(const PolicyKey &key, RequestContextPtr requestContext, + ProtocolFrameSequenceNumber checkId, ServicePluginInterfacePtr plugin, + const AgentTalkerPtr &agentTalkerPtr) : m_agentTalker(agentTalkerPtr), + m_checkId(checkId), m_key(key), m_plugin(plugin), + m_requestContext(requestContext), m_cancelled(false) {} + ~CheckContext() {} + + AgentTalkerPtr m_agentTalker; + const ProtocolFrameSequenceNumber m_checkId; + const PolicyKey m_key; + ServicePluginInterfacePtr m_plugin; + RequestContextPtr m_requestContext; + bool m_cancelled; + + void cancel(void) { + m_cancelled = true; + } + + bool cancelled(void) const { + return m_cancelled; + } +}; + +typedef std::shared_ptr CheckContextPtr; + +} // namespace Cynara + +#endif /* SRC_SERVICE_REQUEST_CHECKCONTEXT_H_ */