-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added InterfaceBase class for SimpleDBus
- Loading branch information
Showing
5 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include <simpledbus/base/Connection.h> | ||
|
||
#include <atomic> | ||
#include <map> | ||
#include <memory> | ||
#include <mutex> | ||
#include <string> | ||
|
||
namespace SimpleDBus { | ||
|
||
class InterfaceBase { | ||
public: | ||
InterfaceBase(std::shared_ptr<Connection> conn, const std::string& bus_name, const std::string& path, | ||
const std::string& interface_name); | ||
|
||
virtual ~InterfaceBase() = default; | ||
|
||
virtual void message_handle(Message& msg) = 0; | ||
|
||
protected: | ||
std::string _path; | ||
std::string _bus_name; | ||
std::string _interface_name; | ||
std::shared_ptr<Connection> _conn; | ||
}; | ||
|
||
} // namespace SimpleDBus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <simpledbus/advanced/InterfaceBase.h> | ||
|
||
using namespace SimpleDBus; | ||
|
||
InterfaceBase::InterfaceBase(std::shared_ptr<Connection> conn, const std::string& bus_name, const std::string& path, | ||
const std::string& interface_name) | ||
: _conn(conn), _bus_name(bus_name), _path(path), _interface_name(interface_name) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters