2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Jan Olszak <j.olszak@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
21 * @author Jan Olszak (j.olszak@samsung.com)
22 * @brief Class for sending the result of a method
25 #ifndef COMMON_IPC_METHOD_RESULT_HPP
26 #define COMMON_IPC_METHOD_RESULT_HPP
28 #include "ipc/types.hpp"
29 #include "logger/logger.hpp"
38 typedef std::shared_ptr<MethodResult> Pointer;
40 MethodResult(Processor& processor,
41 const MethodID methodID,
42 const MessageID messageID,
46 template<typename Data>
47 void set(const std::shared_ptr<Data>& data)
53 void setError(const int code, const std::string& message);
56 Processor& mProcessor;
61 void setInternal(const std::shared_ptr<void>& data);
64 template<typename SentDataType, typename ReceivedDataType>
65 struct MethodHandler {
66 typedef std::function < void(PeerID peerID,
67 std::shared_ptr<ReceivedDataType>& data,
68 MethodResult::Pointer&& methodResult) > type;
73 #endif // COMMON_IPC_METHOD_RESULT_HPP