ResponseTaker is base interface for Protocol class.
Its implementation of appendResponseToBuffer methods throw.
They must be overridden in proper Protocol derivatives.
Change-Id: Ia16008c52f660ebc45143b9e67a741d632c674bc
${CYNARA_SERVICE_PATH}/logic/Logic.cpp
${CYNARA_SERVICE_PATH}/main/Cynara.cpp
${CYNARA_SERVICE_PATH}/main/main.cpp
- ${CYNARA_SERVICE_PATH}/protocol/Protocol.cpp
${CYNARA_SERVICE_PATH}/protocol/ProtocolAdmin.cpp
${CYNARA_SERVICE_PATH}/protocol/ProtocolClient.cpp
${CYNARA_SERVICE_PATH}/protocol/ProtocolSignal.cpp
+ ${CYNARA_SERVICE_PATH}/protocol/ResponseTaker.cpp
${CYNARA_SERVICE_PATH}/request/CheckRequest.cpp
${CYNARA_SERVICE_PATH}/request/Request.cpp
${CYNARA_SERVICE_PATH}/request/RequestContext.cpp
#include <common.h>
+#include <protocol/ResponseTaker.h>
#include <request/Request.h>
#include <response/CheckResponse.h>
namespace Cynara {
-class Protocol {
+class Protocol : public ResponseTaker {
public:
- Protocol();
- virtual ~Protocol();
+ Protocol() = default;
+ virtual ~Protocol() = default;
virtual RequestPtr extractRequestFromBuffer(BinaryQueue &bufferQueue) = 0;
-
- virtual void appendResponseToBuffer(CheckResponse &&response);
};
typedef std::shared_ptr<Protocol> ProtocolPtr;
* limitations under the License.
*/
/*
- * @file Protocol.cpp
+ * @file ResponseTaker.cpp
* @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
* @version 1.0
- * @brief This file implements protocol base class
+ * @brief This file implements ResponseTaker class
*/
+
#include <common.h>
#include <exceptions/NotImplementedException.h>
-#include "Protocol.h"
+#include "ResponseTaker.h"
namespace Cynara {
-Protocol::Protocol() {
-}
-
-Protocol::~Protocol() {
-}
-
-void Protocol::appendResponseToBuffer(CheckResponse &&response UNUSED) {
+void ResponseTaker::appendResponseToBuffer(CheckResponse &&response UNUSED) {
throw NotImplementedException();
}
--- /dev/null
+/*
+ * 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 ResponseTaker.h
+ * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
+ * @version 1.0
+ * @brief This file defines ResponseTaker class
+ */
+
+#ifndef SRC_SERVICE_PROTOCOL_RESPONSETAKER_H_
+#define SRC_SERVICE_PROTOCOL_RESPONSETAKER_H_
+
+#include <response/CheckResponse.h>
+
+namespace Cynara {
+
+class ResponseTaker {
+public:
+ ResponseTaker() = default;
+ virtual ~ResponseTaker() = default;
+
+ virtual void appendResponseToBuffer(CheckResponse &&response);
+};
+
+} // namespace Cynara
+
+#endif /* SRC_SERVICE_PROTOCOL_RESPONSETAKER_H_ */
return m_protocol;
}
+ ResponseTaker &responseTaker(void) {
+ return *m_protocol;
+ }
+
BinaryQueue &writeQueue(void) {
return m_writeQueue;
}