Added support for selective broadcasts
[profile/ivi/common-api-dbus-runtime.git] / src / CommonAPI / DBus / DBusClientId.h
1 /* Copyright (C) 2013 BMW Group
2  * Author: Manfred Bathelt (manfred.bathelt@bmw.de)
3  * Author: Juergen Gehring (juergen.gehring@bmw.de)
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
8 #if !defined (COMMONAPI_INTERNAL_COMPILATION)
9 #error "Only <CommonAPI/CommonAPI.h> can be included directly, this file may disappear or change contents."
10 #endif
11
12 #ifndef DBUSCLIENTID_H_
13 #define DBUSCLIENTID_H_
14
15 #include <CommonAPI/types.h>
16 #include <string>
17
18 namespace CommonAPI {
19 namespace DBus {
20
21 class DBusMessage;
22
23 /**
24  * \brief Implementation of CommonAPI::ClientId for DBus
25  *
26  * This class represents the DBus specific implementation of CommonAPI::ClientId.
27  * It internally uses a string to identify clients. This string is the unique sender id used by dbus.
28  */
29 class DBusClientId: public CommonAPI::ClientId {
30     friend class std::hash<DBusClientId>;
31
32 public:
33     DBusClientId(std::string dbusId);
34
35     bool operator==(CommonAPI::ClientId& clientIdToCompare);
36     bool operator==(DBusClientId& clientIdToCompare);
37     size_t hashCode();
38
39     DBusMessage createMessage(const std::string objectPath, const std::string interfaceName, const std::string signalName) const;
40 protected:
41     std::string dbusId_;
42 };
43
44 } /* namespace DBus */
45 } /* namespace CommonAPI */
46 #endif /* DBUSCLIENTID_H_ */