summaryrefslogtreecommitdiff
path: root/include/CommonAPI/DBus/DBusMainLoopContext.hpp
diff options
context:
space:
mode:
authorLutz Bichler <Lutz.Bichler@bmw.de>2020-10-27 10:00:57 +0100
committerLutz Bichler <Lutz.Bichler@bmw.de>2020-10-27 10:00:57 +0100
commitd1610ad0d6f1b6751964af41a0cc1599e2d7a955 (patch)
tree2144ae231a4ca372f497605d5b4779d2e11c2888 /include/CommonAPI/DBus/DBusMainLoopContext.hpp
parent9f85f0f18d9ca436fb618769149ee02e78fd283b (diff)
downloadgenivi-common-api-dbus-runtime-d1610ad0d6f1b6751964af41a0cc1599e2d7a955.tar.gz
capicxx-dbus-runtime 3.2.0HEAD3.2.0master
Diffstat (limited to 'include/CommonAPI/DBus/DBusMainLoopContext.hpp')
-rw-r--r--include/CommonAPI/DBus/DBusMainLoopContext.hpp41
1 files changed, 3 insertions, 38 deletions
diff --git a/include/CommonAPI/DBus/DBusMainLoopContext.hpp b/include/CommonAPI/DBus/DBusMainLoopContext.hpp
index ecb49ee..c74dc91 100644
--- a/include/CommonAPI/DBus/DBusMainLoopContext.hpp
+++ b/include/CommonAPI/DBus/DBusMainLoopContext.hpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
+// Copyright (C) 2013-2020 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/.
@@ -28,7 +28,7 @@ class DBusConnection;
class DBusDispatchSource: public DispatchSource {
public:
- DBusDispatchSource(DBusConnection* dbusConnection);
+ DBusDispatchSource(std::weak_ptr<DBusConnection> dbusConnection);
~DBusDispatchSource();
bool prepare(int64_t& timeout);
@@ -36,7 +36,7 @@ class DBusDispatchSource: public DispatchSource {
bool dispatch();
private:
- DBusConnection* dbusConnection_;
+ std::weak_ptr<DBusConnection> dbusConnection_;
};
class DBusQueueWatch;
@@ -146,41 +146,6 @@ private:
};
-
-class DBusTimeout: public Timeout {
- public:
- DBusTimeout(::DBusTimeout* libdbusTimeout,
- std::weak_ptr<MainLoopContext>& mainLoopContext,
- std::weak_ptr<DBusConnection>& dbusConnection);
-
- bool isReadyToBeMonitored();
- void startMonitoring();
- void stopMonitoring();
-
- bool dispatch();
-
- int64_t getTimeoutInterval() const;
- int64_t getReadyTime() const;
-
- void setPendingCall(DBusPendingCall* _pendingCall);
-
-#ifdef _WIN32
- __declspec(thread) static DBusTimeout *currentTimeout_;
-#else
- thread_local static DBusTimeout *currentTimeout_;
-#endif
-
- private:
- void recalculateDueTime();
-
- std::atomic<int64_t> dueTimeInMs_;
- ::DBusTimeout* libdbusTimeout_;
- std::weak_ptr<MainLoopContext> mainLoopContext_;
- std::weak_ptr<DBusConnection> dbusConnection_;
- DBusPendingCall *pendingCall_;
-};
-
-
} // namespace DBus
} // namespace CommonAPI