blob: f7e2cdf697a5df5873f15c49d1631790350230e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// Copyright (C) 2013-2015 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#error "Only <CommonAPI/CommonAPI.hpp> can be included directly, this file may disappear or change contents."
#endif
#ifndef COMMONAPI_DBUS_DBUS_FREEDESKTOPPROPERTIESSTUB_HPP_
#define COMMONAPI_DBUS_DBUS_FREEDESKTOPPROPERTIESSTUB_HPP_
#include <memory>
#include <mutex>
#include <string>
#include <CommonAPI/DBus/DBusInterfaceHandler.hpp>
namespace CommonAPI {
namespace DBus {
class DBusStubAdapter;
/**
* Stub for standard <a href="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties">org.freedesktop.dbus.Properties</a> interface.
*
* DBusFreedesktopPropertiesStub gets the DBusStubAdapter for handling the actual properties with instantiation.
*/
class DBusFreedesktopPropertiesStub: public DBusInterfaceHandler {
public:
DBusFreedesktopPropertiesStub(const std::string &_path,
const std::string &_interface,
const std::shared_ptr<DBusProxyConnection> &_connection,
const std::shared_ptr<DBusStubAdapter> &_adapter);
virtual ~DBusFreedesktopPropertiesStub();
const std::string &getObjectPath() const;
static const std::string &getInterface();
virtual const char* getMethodsDBusIntrospectionXmlData() const;
virtual bool onInterfaceDBusMessage(const DBusMessage &_message);
virtual const bool hasFreedesktopProperties();
private:
std::string path_;
std::weak_ptr<DBusProxyConnection> connection_;
std::shared_ptr<DBusStubAdapter> adapter_;
typedef std::unordered_map<std::string, std::shared_ptr<DBusStubAdapter>> DBusInterfacesMap;
DBusInterfacesMap managedInterfaces_;
std::mutex dbusInterfacesLock_;
};
} // namespace DBus
} // namespace CommonAPI
#endif // COMMONAPI_DBUS_DBUS_FREEDESKTOPPROPERTIESSTUB_HPP_
|