2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file dbus_message_in.h
18 * @author Marcin Niesluchowski (m.niesluchow@samsung.com)
20 * @brief DBus incoming message wrapper class header
23 #ifndef COMMON_DBUS_MESSAGE_IN_H
24 #define COMMON_DBUS_MESSAGE_IN_H
26 #include <dbus/dbus.h>
37 MessageIn(DBusMessage *message, bool ref = false);
38 MessageIn(const MessageIn &other) = delete;
39 MessageIn(MessageIn &&other);
42 MessageIn& operator=(const MessageIn &other) = delete;
45 bool isMethodCall(const std::string &interface, const std::string &method);
46 bool isSignal(const std::string &interface, const std::string &signalName);
47 bool isError(const std::string &errorName);
52 friend class MessageIn;
57 void expectArgType(int argType);
58 void expectArgTypeValid();
61 int16_t getArgInt16();
62 uint16_t getArgUint16();
63 int32_t getArgInt32();
64 uint32_t getArgUint32();
65 int64_t getArgInt64();
66 uint64_t getArgUint64();
67 double getArgDouble();
68 std::string getArgString();
75 dbus_message_iter_get_basic(&m_iterator, &value);
80 Iterator(DBusMessageIter *iteratorOver);
81 // message constructor
82 Iterator(DBusMessage *message);
83 DBusMessageIter m_iterator;
89 DBusMessage *m_message;
94 #endif // COMMON_DBUS_MESSAGE_IN_H