DBus::ObjectProxy Class Reference

Object proxies are local proxies that provide local methods and signals for remote objects with dbus interfaces. More...

#include <objectproxy.h>

Inheritance diagram for DBus::ObjectProxy:

Public Types

typedef std::map< std::string, std::shared_ptr< InterfaceProxy > > Interfaces
 

Public Member Functions

virtual ~ObjectProxy ()
 
std::weak_ptr< Connectionconnection () const
 
void set_connection (std::shared_ptr< Connection > conn)
 
const std::string & destination () const
 
void set_destination (const std::string &destination)
 
const Pathpath () const
 
void set_path (const std::string &path)
 
const Interfacesinterfaces () const
 
std::shared_ptr< InterfaceProxyinterface_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< InterfaceProxycreate_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< CallMessagecreate_call_message (const std::string &interface_name, const std::string &method_name) const
 
std::shared_ptr< CallMessagecreate_call_message (const std::string &method_name) const
 
std::shared_ptr< const ReturnMessagecall (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< PeerInterfaceProxygetPeerInterface ()
 
std::shared_ptr< IntrospectableInterfaceProxygetIntrospectableInterface ()
 
std::shared_ptr< PropertiesInterfaceProxygetPropertiesInterface ()
 

Static Public Member Functions

static std::shared_ptr< ObjectProxycreate (const std::string &path)
 Creates an ObjectProxy with a specific path. More...
 
static std::shared_ptr< ObjectProxycreate (const std::string &destination, const std::string &path)
 Creates an ObjectProxy with a specific path. More...
 
static std::shared_ptr< ObjectProxycreate (std::shared_ptr< Connection > conn, const std::string &path)
 
static std::shared_ptr< ObjectProxycreate (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
 

Detailed Description

Object proxies are local proxies that provide local methods and signals for remote objects with dbus interfaces.

Author
Rick L Vinyard Jr rviny.nosp@m.ard@.nosp@m.cs.nm.nosp@m.su.e.nosp@m.du

Member Typedef Documentation

◆ Interfaces

typedef std::map<std::string, std::shared_ptr<InterfaceProxy> > DBus::ObjectProxy::Interfaces

Constructor & Destructor Documentation

◆ ObjectProxy()

DBus::ObjectProxy::ObjectProxy ( std::shared_ptr< Connection conn,
const std::string &  destination,
const std::string &  path 
)
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().

◆ ~ObjectProxy()

DBus::ObjectProxy::~ObjectProxy ( )
virtual

Member Function Documentation

◆ add_interface()

bool DBus::ObjectProxy::add_interface ( std::shared_ptr< InterfaceProxy interface_ptr)

Adds the interface to this object.

Referenced by create_interface(), and ObjectProxy().

◆ add_method()

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().

◆ call()

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.

Parameters
timeout_milliseconds
Returns

◆ connection()

std::weak_ptr< Connection > DBus::ObjectProxy::connection ( ) const

◆ create() [1/4]

std::shared_ptr< ObjectProxy > DBus::ObjectProxy::create ( const std::string &  destination,
const std::string &  path 
)
static

Creates an ObjectProxy with a specific path.

Parameters
destinationThe destination address that this will be a proxy for
pathThe path of the object that this will be a proxy for

References destination(), ObjectProxy(), and path().

◆ create() [2/4]

std::shared_ptr< ObjectProxy > DBus::ObjectProxy::create ( const std::string &  path)
static

Creates an ObjectProxy with a specific path.

Parameters
pathThe path of the object that this will be a proxy for

References ObjectProxy(), and path().

Referenced by DBus::Connection::create_object_proxy().

◆ create() [3/4]

std::shared_ptr< ObjectProxy > DBus::ObjectProxy::create ( std::shared_ptr< Connection conn,
const std::string &  destination,
const std::string &  path 
)
static

References destination(), ObjectProxy(), and path().

◆ create() [4/4]

std::shared_ptr< ObjectProxy > DBus::ObjectProxy::create ( std::shared_ptr< Connection conn,
const std::string &  path 
)
static

References ObjectProxy(), and path().

◆ create_call_message() [1/2]

std::shared_ptr< CallMessage > DBus::ObjectProxy::create_call_message ( const std::string &  interface_name,
const std::string &  method_name 
) const

◆ create_call_message() [2/2]

std::shared_ptr< CallMessage > DBus::ObjectProxy::create_call_message ( const std::string &  method_name) const

◆ create_interface()

std::shared_ptr< InterfaceProxy > DBus::ObjectProxy::create_interface ( const std::string &  name)

Creates and adds the named interface to this object.

Returns
the newly created interface

References add_interface(), and DBus::InterfaceProxy::create().

Referenced by add_method(), create_method(), create_property(), and create_signal().

◆ create_method()

template<class T_type >
std::shared_ptr<MethodProxy<T_type> > DBus::ObjectProxy::create_method ( const std::string &  interface_name,
const std::string &  method_name 
)
inline

Creates a proxy method with a signature based on the template parameters and adds it to the named interface.

Returns
A smart pointer to the newly created method proxy
Parameters
interface_nameThe name of the interface to add this proxy method to
method_nameThe 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().

◆ create_property()

template<class T_type >
std::shared_ptr<PropertyProxy<T_type> > DBus::ObjectProxy::create_property ( const std::string &  interface_name,
const std::string &  property_name,
PropertyAccess  access_type = PropertyAccess::ReadWrite,
PropertyUpdateType  update = PropertyUpdateType::Updates 
)
inline

◆ create_signal()

template<class T_type >
std::shared_ptr<SignalProxy<T_type> > DBus::ObjectProxy::create_signal ( const std::string &  interface_name,
const std::string &  sig_name 
)
inline

Creates a signal proxy with a signature based on the template parameters and adds it to the named interface.

Returns
A smart pointer to the newly created signal proxy
Parameters
interface_nameThe name of the interface to add this proxy signal to
sig_nameThe name to assign to the newly created signal proxy.

References create_interface(), and interface_by_name().

Referenced by DBus::DBusDaemonProxy::DBusDaemonProxy().

◆ DBUS_CXX_PROPAGATE_CONST()

DBus::ObjectProxy::DBUS_CXX_PROPAGATE_CONST ( std::unique_ptr< priv_data >  )
private

◆ destination()

const std::string & DBus::ObjectProxy::destination ( ) const

Referenced by create(), and set_destination().

◆ getIntrospectableInterface()

std::shared_ptr< IntrospectableInterfaceProxy > DBus::ObjectProxy::getIntrospectableInterface ( )

◆ getPeerInterface()

std::shared_ptr< PeerInterfaceProxy > DBus::ObjectProxy::getPeerInterface ( )

◆ getPropertiesInterface()

std::shared_ptr< PropertiesInterfaceProxy > DBus::ObjectProxy::getPropertiesInterface ( )

◆ has_interface() [1/2]

bool DBus::ObjectProxy::has_interface ( const std::string &  name) const

◆ has_interface() [2/2]

bool DBus::ObjectProxy::has_interface ( std::shared_ptr< InterfaceProxy interface_ptr) const

◆ interface_by_name()

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().

◆ interfaces()

const ObjectProxy::Interfaces & DBus::ObjectProxy::interfaces ( ) const

◆ path()

const Path & DBus::ObjectProxy::path ( ) const

◆ remove_interface() [1/2]

void DBus::ObjectProxy::remove_interface ( const std::string &  name)

Removes the first interface with the given name.

◆ remove_interface() [2/2]

void DBus::ObjectProxy::remove_interface ( std::shared_ptr< InterfaceProxy interface_ptr)

Removes the given interface.

◆ set_connection()

void DBus::ObjectProxy::set_connection ( std::shared_ptr< Connection conn)

◆ set_destination()

void DBus::ObjectProxy::set_destination ( const std::string &  destination)

References destination().

◆ set_path()

void DBus::ObjectProxy::set_path ( const std::string &  path)

References path().

◆ signal_interface_added()

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.

Returns

◆ signal_interface_removed()

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.

Returns

The documentation for this class was generated from the following files: