-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ProxyBase class for SimpleDBus
- Loading branch information
Showing
5 changed files
with
42 additions
and
10 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,25 @@ | ||
#pragma once | ||
|
||
#include <simpledbus/base/Connection.h> | ||
#include <string> | ||
#include <memory> | ||
|
||
namespace SimpleDBus { | ||
|
||
class ProxyBase : public std::enable_shared_from_this<ProxyBase> { | ||
public: | ||
ProxyBase(std::shared_ptr<Connection> conn, const std::string& bus_name, const std::string& path); | ||
virtual ~ProxyBase(); | ||
|
||
bool valid() const; | ||
std::string path() const; | ||
|
||
protected: | ||
bool _valid; | ||
|
||
std::string _path; | ||
std::string _bus_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,12 @@ | ||
#include "simpledbus/advanced/ProxyBase.h" | ||
|
||
using namespace SimpleDBus; | ||
|
||
ProxyBase::ProxyBase(std::shared_ptr<Connection> conn, const std::string& bus_name, const std::string& path) | ||
: _conn(conn), _bus_name(bus_name), _path(path), _valid(true) {} | ||
|
||
ProxyBase::~ProxyBase() {} | ||
|
||
bool ProxyBase::valid() const { return _valid; } | ||
|
||
std::string ProxyBase::path() const { return _path; } |
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