2 * Copyright (c) 2011 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.
18 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
21 #ifndef WRTPLUGINS_DBUS_MESSAGE_H_
22 #define WRTPLUGINS_DBUS_MESSAGE_H_
25 #include <dbus/dbus.h>
26 #include <dpl/shared_ptr.h>
27 #include <dpl/optional.h>
28 #include <dpl/noncopyable.h>
33 class Message : private DPL::Noncopyable
39 typedef DPL::SharedPtr<ReadIterator_> ReadIterator;
42 explicit Message(DBusMessage* message);
43 explicit Message(int type);
47 std::string getInterface() const;
48 std::string getPath() const;
49 bool isSignal(const std::string& name) const;
50 ReadIterator getReadIterator() const;
53 // It doesn't need to be non-copyable - DBusMessageIter doesn't require it.
57 explicit ReadIterator_(DBusMessage* message);
62 int getArgType() const;
65 std::string getString() const;
69 T getArgBasic(int type) const;
72 mutable DBusMessageIter m_iterator;
81 DBusMessage* m_message;
84 typedef DPL::SharedPtr<Message> MessagePtr;
89 #endif // WRTPLUGINS_DBUS_MESSAGE_H_