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.
17 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
20 #ifndef WRTDEVICEAPIS_DBUS_MESSAGE_H_
21 #define WRTDEVICEAPIS_DBUS_MESSAGE_H_
24 #include <dbus/dbus.h>
25 #include <dpl/shared_ptr.h>
26 #include <dpl/optional.h>
27 #include <dpl/noncopyable.h>
29 namespace WrtDeviceApis {
31 class Message : private DPL::Noncopyable
37 typedef DPL::SharedPtr<ReadIterator_> ReadIterator;
40 explicit Message(DBusMessage* message);
41 explicit Message(int type);
45 std::string getInterface() const;
46 std::string getPath() const;
47 bool isSignal(const std::string& name) const;
48 ReadIterator getReadIterator() const;
51 // It doesn't need to be non-copyable - DBusMessageIter doesn't require it.
55 explicit ReadIterator_(DBusMessage* message);
60 int getArgType() const;
63 std::string getString() const;
67 T getArgBasic(int type) const;
70 mutable DBusMessageIter m_iterator;
79 DBusMessage* m_message;
82 typedef DPL::SharedPtr<Message> MessagePtr;
86 #endif // WRTDEVICEAPIS_DBUS_MESSAGE_H_