DBus::InterfaceProxy Class Reference

An InterfaceProxy represents a remote Interface in another application on the DBus. More...

#include <interfaceproxy.h>

Inheritance diagram for DBus::InterfaceProxy:

Public Types

typedef std::multimap< std::string, std::shared_ptr< MethodProxyBase > > Methods
 
typedef std::set< std::shared_ptr< SignalProxyBase > > Signals
 

Public Member Functions

virtual ~InterfaceProxy ()
 
ObjectProxyobject () const
 
Path path () const
 
std::weak_ptr< Connectionconnection () const
 
const std::string & name () const
 
const Methodsmethods () const
 
std::shared_ptr< MethodProxyBasemethod (const std::string &name) const
 Returns the first method with the given name. More...
 
template<class T_type >
std::shared_ptr< MethodProxy< T_type > > create_method (const std::string &name)
 
bool add_method (std::shared_ptr< MethodProxyBase > method)
 Adds the named method. More...
 
void remove_method (const std::string &name)
 Removes the method with the given name. More...
 
void remove_method (std::shared_ptr< MethodProxyBase > method)
 Removed the specific method. More...
 
bool has_method (const std::string &name) const
 True if the interface has a method with the given name. More...
 
bool has_method (std::shared_ptr< MethodProxyBase > method) const
 True if the interface has the specified method. More...
 
const std::map< std::string, std::shared_ptr< PropertyProxyBase > > & properties () const
 Get the (local) cache of all properties. More...
 
std::shared_ptr< PropertyProxyBaseproperty (const std::string &name) const
 
bool has_property (const std::string &name) const
 True if the interface has a property with the given name. More...
 
bool has_property (std::shared_ptr< PropertyProxyBase > property) const
 True if the interface has the specified property. More...
 
void remove_property (const std::string &name)
 Removes the property with the given name. More...
 
void remove_property (std::shared_ptr< PropertyProxyBase > method)
 Removed the specific property. More...
 
template<class T_type >
std::shared_ptr< PropertyProxy< T_type > > create_property (const std::string &name, PropertyUpdateType update=PropertyUpdateType::Updates)
 Create a property with the given type, and the given name. More...
 
bool add_property (std::shared_ptr< PropertyProxyBase > property)
 Adds the given property. More...
 
void cache_properties ()
 Ask the remote object for the status of all of its properties. More...
 
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
 
template<class T_arg >
std::shared_ptr< SignalProxy< T_arg > > create_signal (const std::string &sig_name)
 
const Signalssignals () const
 
std::shared_ptr< SignalProxyBasesignal (const std::string &signame)
 
bool add_signal (std::shared_ptr< SignalProxyBase > sig)
 
bool remove_signal (const std::string &signame)
 
bool remove_signal (std::shared_ptr< SignalProxyBase > sig)
 
bool has_signal (const std::string &signame) const
 
bool has_signal (std::shared_ptr< SignalProxyBase > sig) const
 

Static Public Member Functions

static std::shared_ptr< InterfaceProxycreate (const std::string &name=std::string())
 

Protected Member Functions

 InterfaceProxy (const std::string &name)
 

Private Member Functions

void on_object_set_path (const std::string &path)
 
void set_object (ObjectProxy *obj)
 
void property_updated (std::string, std::map< std::string, DBus::Variant >, std::vector< std::string >)
 
 DBUS_CXX_PROPAGATE_CONST (std::unique_ptr< priv_data >) m_priv
 

Friends

class ObjectProxy
 

Detailed Description

An InterfaceProxy represents a remote Interface in another application on the DBus.

Note that the interface name is immutable and cannot be changed once the interface has been created.

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

Member Typedef Documentation

◆ Methods

typedef std::multimap<std::string, std::shared_ptr<MethodProxyBase> > DBus::InterfaceProxy::Methods

◆ Signals

typedef std::set<std::shared_ptr<SignalProxyBase> > DBus::InterfaceProxy::Signals

Constructor & Destructor Documentation

◆ InterfaceProxy()

DBus::InterfaceProxy::InterfaceProxy ( const std::string &  name)
protected

References name().

Referenced by create().

◆ ~InterfaceProxy()

DBus::InterfaceProxy::~InterfaceProxy ( )
virtual

Member Function Documentation

◆ add_method()

bool DBus::InterfaceProxy::add_method ( std::shared_ptr< MethodProxyBase method)

Adds the named method.

If a method with the same name already exists, does not replace the current method(returns false).

References has_method(), and method().

Referenced by create_method().

◆ add_property()

bool DBus::InterfaceProxy::add_property ( std::shared_ptr< PropertyProxyBase property)

Adds the given property.

If a property with the same name already exists, does not replace the current property(returns false).

References has_property(), and property().

Referenced by create_property().

◆ add_signal()

bool DBus::InterfaceProxy::add_signal ( std::shared_ptr< SignalProxyBase sig)

References connection(), name(), and path().

Referenced by create_signal().

◆ cache_properties()

void DBus::InterfaceProxy::cache_properties ( )

Ask the remote object for the status of all of its properties.

References call(), DBus::CallMessage::create(), LOGGER_NAME, property(), and SIMPLELOGGER_TRACE.

◆ call()

std::shared_ptr< const ReturnMessage > DBus::InterfaceProxy::call ( std::shared_ptr< const CallMessage call_message,
int  timeout_milliseconds = -1 
) const

Referenced by cache_properties().

◆ connection()

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

Referenced by add_signal(), and set_object().

◆ create()

std::shared_ptr< InterfaceProxy > DBus::InterfaceProxy::create ( const std::string &  name = std::string())
static

◆ create_call_message()

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

◆ create_method()

template<class T_type >
std::shared_ptr<MethodProxy<T_type> > DBus::InterfaceProxy::create_method ( const std::string &  name)
inline

References add_method(), method(), and name().

◆ create_property()

template<class T_type >
std::shared_ptr<PropertyProxy<T_type> > DBus::InterfaceProxy::create_property ( const std::string &  name,
PropertyUpdateType  update = PropertyUpdateType::Updates 
)
inline

Create a property with the given type, and the given name.

References add_property(), DBus::PropertyProxy< T_type >::create(), and name().

◆ create_signal()

template<class T_arg >
std::shared_ptr<SignalProxy<T_arg > > DBus::InterfaceProxy::create_signal ( const std::string &  sig_name)
inline

◆ DBUS_CXX_PROPAGATE_CONST()

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

◆ has_method() [1/2]

bool DBus::InterfaceProxy::has_method ( const std::string &  name) const

True if the interface has a method with the given name.

References name().

Referenced by add_method().

◆ has_method() [2/2]

bool DBus::InterfaceProxy::has_method ( std::shared_ptr< MethodProxyBase method) const

True if the interface has the specified method.

References method().

◆ has_property() [1/2]

bool DBus::InterfaceProxy::has_property ( const std::string &  name) const

True if the interface has a property with the given name.

References name().

Referenced by add_property().

◆ has_property() [2/2]

bool DBus::InterfaceProxy::has_property ( std::shared_ptr< PropertyProxyBase property) const

True if the interface has the specified property.

References property().

◆ has_signal() [1/2]

bool DBus::InterfaceProxy::has_signal ( const std::string &  signame) const

Referenced by remove_signal().

◆ has_signal() [2/2]

bool DBus::InterfaceProxy::has_signal ( std::shared_ptr< SignalProxyBase sig) const

◆ method()

std::shared_ptr< MethodProxyBase > DBus::InterfaceProxy::method ( const std::string &  name) const

Returns the first method with the given name.

References name().

Referenced by add_method(), create_method(), has_method(), and remove_method().

◆ methods()

const InterfaceProxy::Methods & DBus::InterfaceProxy::methods ( ) const

◆ name()

◆ object()

ObjectProxy * DBus::InterfaceProxy::object ( ) const

◆ on_object_set_path()

void DBus::InterfaceProxy::on_object_set_path ( const std::string &  path)
private

References path().

◆ path()

Path DBus::InterfaceProxy::path ( ) const

◆ properties()

const std::map< std::string, std::shared_ptr< PropertyProxyBase > > & DBus::InterfaceProxy::properties ( ) const

Get the (local) cache of all properties.

Returns

◆ property()

std::shared_ptr< PropertyProxyBase > DBus::InterfaceProxy::property ( const std::string &  name) const

◆ property_updated()

void DBus::InterfaceProxy::property_updated ( std::string  iface,
std::map< std::string, DBus::Variant changed,
std::vector< std::string >  invalidated 
)
private

References LOGGER_NAME, property(), and SIMPLELOGGER_TRACE.

Referenced by set_object().

◆ remove_method() [1/2]

void DBus::InterfaceProxy::remove_method ( const std::string &  name)

Removes the method with the given name.

References method(), and name().

◆ remove_method() [2/2]

void DBus::InterfaceProxy::remove_method ( std::shared_ptr< MethodProxyBase method)

Removed the specific method.

References method().

◆ remove_property() [1/2]

void DBus::InterfaceProxy::remove_property ( const std::string &  name)

Removes the property with the given name.

References name(), and property().

◆ remove_property() [2/2]

void DBus::InterfaceProxy::remove_property ( std::shared_ptr< PropertyProxyBase method)

Removed the specific property.

References property().

◆ remove_signal() [1/2]

bool DBus::InterfaceProxy::remove_signal ( const std::string &  signame)

References signal().

◆ remove_signal() [2/2]

bool DBus::InterfaceProxy::remove_signal ( std::shared_ptr< SignalProxyBase sig)

References has_signal().

◆ set_object()

◆ signal()

std::shared_ptr< SignalProxyBase > DBus::InterfaceProxy::signal ( const std::string &  signame)

Referenced by remove_signal().

◆ signals()

const InterfaceProxy::Signals & DBus::InterfaceProxy::signals ( ) const

Friends And Related Function Documentation

◆ ObjectProxy

friend class ObjectProxy
friend

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