Object proxies are local proxies that provide local methods and signals for remote objects with dbus interfaces. More...
#include <objectproxy.h>
Public Types | |
typedef std::map< std::string, std::shared_ptr< InterfaceProxy > > | Interfaces |
Public Member Functions | |
virtual | ~ObjectProxy () |
std::weak_ptr< Connection > | connection () const |
void | set_connection (std::shared_ptr< Connection > conn) |
const std::string & | destination () const |
void | set_destination (const std::string &destination) |
const Path & | path () const |
void | set_path (const std::string &path) |
const Interfaces & | interfaces () const |
std::shared_ptr< InterfaceProxy > | interface_by_name (const std::string &name) const |
Returns the first interface with the given name. More... | |
bool | add_interface (std::shared_ptr< InterfaceProxy > interface_ptr) |
Adds the interface to this object. More... | |
std::shared_ptr< InterfaceProxy > | create_interface (const std::string &name) |
Creates and adds the named interface to this object. More... | |
void | remove_interface (const std::string &name) |
Removes the first interface with the given name. More... | |
void | remove_interface (std::shared_ptr< InterfaceProxy > interface_ptr) |
Removes the given interface. More... | |
bool | has_interface (const std::string &name) const |
bool | has_interface (std::shared_ptr< InterfaceProxy > interface_ptr) const |
bool | add_method (const std::string &interface_name, std::shared_ptr< MethodProxyBase > method) |
Adds the method to the named interface. More... | |
std::shared_ptr< CallMessage > | create_call_message (const std::string &interface_name, const std::string &method_name) const |
std::shared_ptr< CallMessage > | create_call_message (const std::string &method_name) const |
std::shared_ptr< const ReturnMessage > | call (std::shared_ptr< const CallMessage >, int timeout_milliseconds=-1) const |
Forwards this CallMessage to the Connection that this ObjectProxy is on, and returns a message with the response. More... | |
template<class T_type > | |
std::shared_ptr< MethodProxy< T_type > > | create_method (const std::string &interface_name, const std::string &method_name) |
Creates a proxy method with a signature based on the template parameters and adds it to the named interface. More... | |
template<class T_type > | |
std::shared_ptr< SignalProxy< T_type > > | create_signal (const std::string &interface_name, const std::string &sig_name) |
Creates a signal proxy with a signature based on the template parameters and adds it to the named interface. More... | |
template<class T_type > | |
std::shared_ptr< PropertyProxy< T_type > > | create_property (const std::string &interface_name, const std::string &property_name, PropertyAccess access_type=PropertyAccess::ReadWrite, PropertyUpdateType update=PropertyUpdateType::Updates) |
sigc::signal< void(std::shared_ptr< InterfaceProxy >)> | signal_interface_added () |
Return a signal that you may connect to when an interface is added. More... | |
sigc::signal< void(std::shared_ptr< InterfaceProxy >)> | signal_interface_removed () |
Return a signal that you may connect to when an interface is removed. More... | |
std::shared_ptr< PeerInterfaceProxy > | getPeerInterface () |
std::shared_ptr< IntrospectableInterfaceProxy > | getIntrospectableInterface () |
std::shared_ptr< PropertiesInterfaceProxy > | getPropertiesInterface () |
Static Public Member Functions | |
static std::shared_ptr< ObjectProxy > | create (const std::string &path) |
Creates an ObjectProxy with a specific path. More... | |
static std::shared_ptr< ObjectProxy > | create (const std::string &destination, const std::string &path) |
Creates an ObjectProxy with a specific path. More... | |
static std::shared_ptr< ObjectProxy > | create (std::shared_ptr< Connection > conn, const std::string &path) |
static std::shared_ptr< ObjectProxy > | create (std::shared_ptr< Connection > conn, const std::string &destination, const std::string &path) |
Protected Member Functions | |
ObjectProxy (std::shared_ptr< Connection > conn, const std::string &destination, const std::string &path) | |
This class has a protected constructor. More... | |
Private Member Functions | |
DBUS_CXX_PROPAGATE_CONST (std::unique_ptr< priv_data >) m_priv | |
Object proxies are local proxies that provide local methods and signals for remote objects with dbus interfaces.
typedef std::map<std::string, std::shared_ptr<InterfaceProxy> > DBus::ObjectProxy::Interfaces |
|
protected |
This class has a protected constructor.
Use the create()
methods to obtain a smart std::shared_ptr<ObjectProxy> to a new instance.
References add_interface().
Referenced by create().
|
virtual |
bool DBus::ObjectProxy::add_interface | ( | std::shared_ptr< InterfaceProxy > | interface_ptr | ) |
Adds the interface to this object.
Referenced by create_interface(), and ObjectProxy().
bool DBus::ObjectProxy::add_method | ( | const std::string & | interface_name, |
std::shared_ptr< MethodProxyBase > | method | ||
) |
Adds the method to the named interface.
References create_interface(), and interface_by_name().
std::shared_ptr< const ReturnMessage > DBus::ObjectProxy::call | ( | std::shared_ptr< const CallMessage > | call_message, |
int | timeout_milliseconds = -1 |
||
) | const |
Forwards this CallMessage to the Connection that this ObjectProxy is on, and returns a message with the response.
timeout_milliseconds |
std::weak_ptr< Connection > DBus::ObjectProxy::connection | ( | ) | const |
|
static |
Creates an ObjectProxy with a specific path.
destination | The destination address that this will be a proxy for |
path | The path of the object that this will be a proxy for |
References destination(), ObjectProxy(), and path().
|
static |
Creates an ObjectProxy with a specific path.
path | The path of the object that this will be a proxy for |
References ObjectProxy(), and path().
Referenced by DBus::Connection::create_object_proxy().
|
static |
References destination(), ObjectProxy(), and path().
|
static |
References ObjectProxy(), and path().
std::shared_ptr< CallMessage > DBus::ObjectProxy::create_call_message | ( | const std::string & | interface_name, |
const std::string & | method_name | ||
) | const |
References DBus::CallMessage::create().
std::shared_ptr< CallMessage > DBus::ObjectProxy::create_call_message | ( | const std::string & | method_name | ) | const |
References DBus::CallMessage::create().
std::shared_ptr< InterfaceProxy > DBus::ObjectProxy::create_interface | ( | const std::string & | name | ) |
Creates and adds the named interface to this object.
References add_interface(), and DBus::InterfaceProxy::create().
Referenced by add_method(), create_method(), create_property(), and create_signal().
|
inline |
Creates a proxy method with a signature based on the template parameters and adds it to the named interface.
interface_name | The name of the interface to add this proxy method to |
method_name | The name to assign to the newly create method proxy. This name will be used to perform the dbus-call. |
References create_interface(), and interface_by_name().
Referenced by DBus::DBusDaemonProxy::DBusDaemonProxy().
|
inline |
References create_interface(), and interface_by_name().
|
inline |
Creates a signal proxy with a signature based on the template parameters and adds it to the named interface.
interface_name | The name of the interface to add this proxy signal to |
sig_name | The name to assign to the newly created signal proxy. |
References create_interface(), and interface_by_name().
Referenced by DBus::DBusDaemonProxy::DBusDaemonProxy().
|
private |
const std::string & DBus::ObjectProxy::destination | ( | ) | const |
Referenced by create(), and set_destination().
std::shared_ptr< IntrospectableInterfaceProxy > DBus::ObjectProxy::getIntrospectableInterface | ( | ) |
std::shared_ptr< PeerInterfaceProxy > DBus::ObjectProxy::getPeerInterface | ( | ) |
std::shared_ptr< PropertiesInterfaceProxy > DBus::ObjectProxy::getPropertiesInterface | ( | ) |
bool DBus::ObjectProxy::has_interface | ( | const std::string & | name | ) | const |
bool DBus::ObjectProxy::has_interface | ( | std::shared_ptr< InterfaceProxy > | interface_ptr | ) | const |
std::shared_ptr< InterfaceProxy > DBus::ObjectProxy::interface_by_name | ( | const std::string & | name | ) | const |
Returns the first interface with the given name.
Referenced by add_method(), create_method(), create_property(), and create_signal().
const ObjectProxy::Interfaces & DBus::ObjectProxy::interfaces | ( | ) | const |
const Path & DBus::ObjectProxy::path | ( | ) | const |
Referenced by create(), DBus::DBusDaemonProxy::create(), and set_path().
void DBus::ObjectProxy::remove_interface | ( | const std::string & | name | ) |
Removes the first interface with the given name.
void DBus::ObjectProxy::remove_interface | ( | std::shared_ptr< InterfaceProxy > | interface_ptr | ) |
Removes the given interface.
void DBus::ObjectProxy::set_connection | ( | std::shared_ptr< Connection > | conn | ) |
void DBus::ObjectProxy::set_destination | ( | const std::string & | destination | ) |
References destination().
void DBus::ObjectProxy::set_path | ( | const std::string & | path | ) |
References path().
sigc::signal< void(std::shared_ptr< InterfaceProxy >)> DBus::ObjectProxy::signal_interface_added | ( | ) |
Return a signal that you may connect to when an interface is added.
This will be emitted from the thread that added the interface.
sigc::signal< void(std::shared_ptr< InterfaceProxy >)> DBus::ObjectProxy::signal_interface_removed | ( | ) |
Return a signal that you may connect to when an interface is removed.
This will be emitted from the thread that added the interface.