dbus-cxx logo
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
DBus::Interface Class Reference

#include <interface.h>

Public Types

typedef DBusCxxPointer< Interfacepointer
 Typedef to smart pointers to Interface. More...
 
typedef DBusCxxWeakPointer
< Interface
weak_pointer
 Typedef to weak smart pointers to Interface. More...
 
typedef std::multimap
< std::string,
MethodBase::pointer
Methods
 Typedef to the storage structure for methods. More...
 
typedef std::set
< signal_base::pointer
Signals
 Typedef to the storage structure for signals. More...
 

Public Member Functions

virtual ~Interface ()
 
Objectobject () const
 Returns the object associated with this interface. More...
 
Path path () const
 Returns the path of the object associated with this interface or a null string if no object is associated. More...
 
DBusCxxPointer< Connectionconnection () const
 Returns the connection associated with this interface's object or a null pointer if no object is associated. More...
 
HandlerResult handle_call_message (DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
 Handles the specified call message on the specified connection. More...
 
const std::string & name () const
 Get the name of this interface. More...
 
void set_name (const std::string &new_name)
 Sets the name of this interface. More...
 
const Methodsmethods () const
 Returns the methods associated with this interface. More...
 
MethodBase::pointer method (const std::string &name) const
 Returns the first method with the given name. More...
 
template<class T_return >
DBusCxxPointer< Method
< T_return > > 
create_method (const std::string &name)
 Creates a method with a return value (possibly void ) and 0 parameters. More...
 
template<class T_return , class T_arg1 >
DBusCxxPointer< Method
< T_return, T_arg1 > > 
create_method (const std::string &name)
 Creates a method with a return value (possibly void ) and 1 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2 > > 
create_method (const std::string &name)
 Creates a method with a return value (possibly void ) and 2 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3 > > 
create_method (const std::string &name)
 Creates a method with a return value (possibly void ) and 3 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4 > > 
create_method (const std::string &name)
 Creates a method with a return value (possibly void ) and 4 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5 > > 
create_method (const std::string &name)
 Creates a method with a return value (possibly void ) and 5 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6 > > 
create_method (const std::string &name)
 Creates a method with a return value (possibly void ) and 6 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6,
T_arg7 > > 
create_method (const std::string &name)
 Creates a method with a return value (possibly void ) and 7 parameters. More...
 
template<class T_return >
DBusCxxPointer< Method
< T_return > > 
create_method (const std::string &name, sigc::slot0< T_return > slot)
 Creates a method with a signature equivalent to the provided. More...
 
template<class T_return , class T_arg1 >
DBusCxxPointer< Method
< T_return, T_arg1 > > 
create_method (const std::string &name, sigc::slot1< T_return, T_arg1 > slot)
 Creates a method with a signature equivalent to the provided. More...
 
template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2 > > 
create_method (const std::string &name, sigc::slot2< T_return, T_arg1, T_arg2 > slot)
 Creates a method with a signature equivalent to the provided. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3 > > 
create_method (const std::string &name, sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > slot)
 Creates a method with a signature equivalent to the provided. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4 > > 
create_method (const std::string &name, sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > slot)
 Creates a method with a signature equivalent to the provided. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5 > > 
create_method (const std::string &name, sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > slot)
 Creates a method with a signature equivalent to the provided. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6 > > 
create_method (const std::string &name, sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > slot)
 Creates a method with a signature equivalent to the provided. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 >
DBusCxxPointer< Method
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6,
T_arg7 > > 
create_method (const std::string &name, sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > slot)
 Creates a method with a signature equivalent to the provided. More...
 
bool add_method (MethodBase::pointer method)
 Adds the named method. More...
 
void remove_method (const std::string &name)
 Removes the first method with the given name. More...
 
bool has_method (const std::string &name) const
 True if the interface has a method with the given name. More...
 
bool add_signal (signal_base::pointer signal)
 Adds the given signal. More...
 
bool remove_signal (signal_base::pointer signal)
 Removes the given signal. More...
 
bool remove_signal (const std::string &name)
 Removes all signals with the given name. More...
 
bool has_signal (signal_base::pointer signal) const
 True if the given signal is part of this interface. More...
 
bool has_signal (const std::string &name) const
 True if this interface has at least one signal with the given name. More...
 
template<class T_return >
DBusCxxPointer< signal
< T_return > > 
create_signal (const std::string &name)
 Creates a signal with a return value (possibly void ) and 0 parameters. More...
 
template<class T_return , class T_arg1 >
DBusCxxPointer< signal
< T_return, T_arg1 > > 
create_signal (const std::string &name)
 Creates a signal with a return value (possibly void ) and 1 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< signal
< T_return, T_arg1, T_arg2 > > 
create_signal (const std::string &name)
 Creates a signal with a return value (possibly void ) and 2 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer< signal
< T_return, T_arg1, T_arg2,
T_arg3 > > 
create_signal (const std::string &name)
 Creates a signal with a return value (possibly void ) and 3 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer< signal
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4 > > 
create_signal (const std::string &name)
 Creates a signal with a return value (possibly void ) and 4 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer< signal
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5 > > 
create_signal (const std::string &name)
 Creates a signal with a return value (possibly void ) and 5 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 >
DBusCxxPointer< signal
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6 > > 
create_signal (const std::string &name)
 Creates a signal with a return value (possibly void ) and 6 parameters. More...
 
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 >
DBusCxxPointer< signal
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6,
T_arg7 > > 
create_signal (const std::string &name)
 Creates a signal with a return value (possibly void ) and 7 parameters. More...
 
const Signalssignals ()
 Returns the signals associated with this interface. More...
 
signal_base::pointer signal (const std::string &signal_name)
 Returns the first signal found with a matching name. More...
 
sigc::signal< void, const
std::string &, const
std::string & > 
signal_name_changed ()
 Signal emitted when the name is changed. More...
 
sigc::signal< void,
MethodBase::pointer
signal_method_added ()
 Signal emitted when a method of the given name is added. More...
 
sigc::signal< void,
MethodBase::pointer
signal_method_removed ()
 Signal emitted when a method of the given name is removed. More...
 
std::string introspect (int space_depth=0) const
 Returns a DBus XML description of this interface. More...
 

Static Public Member Functions

static pointer create (const std::string &name=std::string())
 Creates a named Interface. More...
 

Protected Types

typedef std::map
< MethodBase::pointer,
sigc::connection > 
MethodSignalNameConnections
 

Protected Member Functions

 Interface (const std::string &name)
 This class has a protected constructor. More...
 
void set_object (Object *object)
 
void on_method_name_changed (const std::string &oldname, const std::string &newname, MethodBase::pointer method)
 Callback point that updates the method name map when a method changes its name. More...
 
void set_connection (DBusCxxPointer< Connection > conn)
 
void set_path (const std::string &new_path)
 

Protected Attributes

std::string m_name
 
Methods m_methods
 
Signals m_signals
 
pthread_rwlock_t m_methods_rwlock
 
pthread_rwlock_t m_signals_rwlock
 
pthread_mutex_t m_name_mutex
 Ensures that the name doesn't change while the name changed signal is emitting. More...
 
sigc::signal< void, const
std::string &, const
std::string & > 
m_signal_name_changed
 
sigc::signal< void,
MethodBase::pointer
m_signal_method_added
 
sigc::signal< void,
MethodBase::pointer
m_signal_method_removed
 
MethodSignalNameConnections m_method_signal_name_connections
 

Private Attributes

Objectm_object
 

Friends

class Object
 

Detailed Description

Todo:
Do something about the signals when the interface name is changed
Author
Rick L Vinyard Jr rviny.nosp@m.ard@.nosp@m.cs.nm.nosp@m.su.e.nosp@m.du

Member Typedef Documentation

typedef std::multimap<std::string, MethodBase::pointer> DBus::Interface::Methods

Typedef to the storage structure for methods.

Data Structure - multimap is used since multiple methods can have the same name. This is what allows for overloading. Key - method name Value -smart pointer to a method.

Can access type as Interface::Methods

typedef std::map<MethodBase::pointer,sigc::connection> DBus::Interface::MethodSignalNameConnections
protected
typedef DBusCxxPointer<Interface> DBus::Interface::pointer

Typedef to smart pointers to Interface.

Can access type as Interface::pointer

Typedef to the storage structure for signals.

Data Structure - sets is used since signal names are not needed for the interface, but must be unique.

Can access type as Interface::Signals

typedef DBusCxxWeakPointer<Interface> DBus::Interface::weak_pointer

Typedef to weak smart pointers to Interface.

Can access type as Interface::weak_pointer

Constructor & Destructor Documentation

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

This class has a protected constructor.

Use the create() methods to obtain a smart pointer to a new instance.

References m_methods_rwlock, m_name_mutex, and m_signals_rwlock.

Referenced by create().

DBus::Interface::~Interface ( )
virtual

Member Function Documentation

bool DBus::Interface::add_method ( MethodBase::pointer  method)
bool DBus::Interface::add_signal ( signal_base::pointer  signal)

Adds the given signal.

Returns
true if the signal was successfully added, false otherwise

References connection(), m_name, m_signals, m_signals_rwlock, name(), and path().

Referenced by create_signal().

Connection::pointer DBus::Interface::connection ( ) const

Returns the connection associated with this interface's object or a null pointer if no object is associated.

References m_object.

Referenced by add_signal().

Interface::pointer DBus::Interface::create ( const std::string &  name = std::string())
static

Creates a named Interface.

Parameters
nameThe name of this interface

References Interface().

Referenced by DBus::Object::create_interface().

template<class T_return >
DBusCxxPointer< Method< T_return > > DBus::Interface::create_method ( const std::string &  name)

Creates a method with a return value (possibly void ) and 0 parameters.

Returns
A smart pointer to the newly created method
Parameters
nameThe name that will be associated with this method

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 >
DBusCxxPointer< Method< T_return, T_arg1 > > DBus::Interface::create_method ( const std::string &  name)

Creates a method with a return value (possibly void ) and 1 parameters.

Returns
A smart pointer to the newly created method
Parameters
nameThe name that will be associated with this method

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2 > > DBus::Interface::create_method ( const std::string &  name)

Creates a method with a return value (possibly void ) and 2 parameters.

Returns
A smart pointer to the newly created method
Parameters
nameThe name that will be associated with this method

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3 > > DBus::Interface::create_method ( const std::string &  name)

Creates a method with a return value (possibly void ) and 3 parameters.

Returns
A smart pointer to the newly created method
Parameters
nameThe name that will be associated with this method

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > > DBus::Interface::create_method ( const std::string &  name)

Creates a method with a return value (possibly void ) and 4 parameters.

Returns
A smart pointer to the newly created method
Parameters
nameThe name that will be associated with this method

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > > DBus::Interface::create_method ( const std::string &  name)

Creates a method with a return value (possibly void ) and 5 parameters.

Returns
A smart pointer to the newly created method
Parameters
nameThe name that will be associated with this method

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > > DBus::Interface::create_method ( const std::string &  name)

Creates a method with a return value (possibly void ) and 6 parameters.

Returns
A smart pointer to the newly created method
Parameters
nameThe name that will be associated with this method

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > > DBus::Interface::create_method ( const std::string &  name)

Creates a method with a return value (possibly void ) and 7 parameters.

Returns
A smart pointer to the newly created method
Parameters
nameThe name that will be associated with this method

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return >
DBusCxxPointer< Method< T_return > > DBus::Interface::create_method ( const std::string &  name,
sigc::slot0< T_return >  slot 
)

Creates a method with a signature equivalent to the provided.

Parameters
slotparameter's signature
Returns
A smart pointer to the newly created method
Parameters
slotThis slot will be called with the given signature when the method is invoked

Template parameters of the sigc::slot will determine the signature of the method created.

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 >
DBusCxxPointer< Method< T_return, T_arg1 > > DBus::Interface::create_method ( const std::string &  name,
sigc::slot1< T_return, T_arg1 >  slot 
)

Creates a method with a signature equivalent to the provided.

Parameters
slotparameter's signature
Returns
A smart pointer to the newly created method
Parameters
slotThis slot will be called with the given signature when the method is invoked

Template parameters of the sigc::slot will determine the signature of the method created.

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2 > > DBus::Interface::create_method ( const std::string &  name,
sigc::slot2< T_return, T_arg1, T_arg2 >  slot 
)

Creates a method with a signature equivalent to the provided.

Parameters
slotparameter's signature
Returns
A smart pointer to the newly created method
Parameters
slotThis slot will be called with the given signature when the method is invoked

Template parameters of the sigc::slot will determine the signature of the method created.

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3 > > DBus::Interface::create_method ( const std::string &  name,
sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 >  slot 
)

Creates a method with a signature equivalent to the provided.

Parameters
slotparameter's signature
Returns
A smart pointer to the newly created method
Parameters
slotThis slot will be called with the given signature when the method is invoked

Template parameters of the sigc::slot will determine the signature of the method created.

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > > DBus::Interface::create_method ( const std::string &  name,
sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 >  slot 
)

Creates a method with a signature equivalent to the provided.

Parameters
slotparameter's signature
Returns
A smart pointer to the newly created method
Parameters
slotThis slot will be called with the given signature when the method is invoked

Template parameters of the sigc::slot will determine the signature of the method created.

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > > DBus::Interface::create_method ( const std::string &  name,
sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 >  slot 
)

Creates a method with a signature equivalent to the provided.

Parameters
slotparameter's signature
Returns
A smart pointer to the newly created method
Parameters
slotThis slot will be called with the given signature when the method is invoked

Template parameters of the sigc::slot will determine the signature of the method created.

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > > DBus::Interface::create_method ( const std::string &  name,
sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 >  slot 
)

Creates a method with a signature equivalent to the provided.

Parameters
slotparameter's signature
Returns
A smart pointer to the newly created method
Parameters
slotThis slot will be called with the given signature when the method is invoked

Template parameters of the sigc::slot will determine the signature of the method created.

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 >
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > > DBus::Interface::create_method ( const std::string &  name,
sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >  slot 
)

Creates a method with a signature equivalent to the provided.

Parameters
slotparameter's signature
Returns
A smart pointer to the newly created method
Parameters
slotThis slot will be called with the given signature when the method is invoked

Template parameters of the sigc::slot will determine the signature of the method created.

References add_method(), DBus::Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and method().

template<class T_return >
DBusCxxPointer< signal< T_return > > DBus::Interface::create_signal ( const std::string &  name)

Creates a signal with a return value (possibly void ) and 0 parameters.

Returns
A smart pointer to the newly created signal
Parameters
nameThe name that will be associated with this signal

References add_signal(), DBus::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and m_name.

template<class T_return , class T_arg1 >
DBusCxxPointer< signal< T_return, T_arg1 > > DBus::Interface::create_signal ( const std::string &  name)

Creates a signal with a return value (possibly void ) and 1 parameters.

Returns
A smart pointer to the newly created signal
Parameters
nameThe name that will be associated with this signal

References add_signal(), DBus::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and m_name.

template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< signal< T_return, T_arg1, T_arg2 > > DBus::Interface::create_signal ( const std::string &  name)

Creates a signal with a return value (possibly void ) and 2 parameters.

Returns
A smart pointer to the newly created signal
Parameters
nameThe name that will be associated with this signal

References add_signal(), DBus::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and m_name.

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer< signal< T_return, T_arg1, T_arg2, T_arg3 > > DBus::Interface::create_signal ( const std::string &  name)

Creates a signal with a return value (possibly void ) and 3 parameters.

Returns
A smart pointer to the newly created signal
Parameters
nameThe name that will be associated with this signal

References add_signal(), DBus::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and m_name.

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer< signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > > DBus::Interface::create_signal ( const std::string &  name)

Creates a signal with a return value (possibly void ) and 4 parameters.

Returns
A smart pointer to the newly created signal
Parameters
nameThe name that will be associated with this signal

References add_signal(), DBus::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and m_name.

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer< signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > > DBus::Interface::create_signal ( const std::string &  name)

Creates a signal with a return value (possibly void ) and 5 parameters.

Returns
A smart pointer to the newly created signal
Parameters
nameThe name that will be associated with this signal

References add_signal(), DBus::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and m_name.

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 >
DBusCxxPointer< signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > > DBus::Interface::create_signal ( const std::string &  name)

Creates a signal with a return value (possibly void ) and 6 parameters.

Returns
A smart pointer to the newly created signal
Parameters
nameThe name that will be associated with this signal

References add_signal(), DBus::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and m_name.

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 , class T_arg7 >
DBusCxxPointer< signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > > DBus::Interface::create_signal ( const std::string &  name)

Creates a signal with a return value (possibly void ) and 7 parameters.

Returns
A smart pointer to the newly created signal
Parameters
nameThe name that will be associated with this signal

References add_signal(), DBus::signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 >::create(), and m_name.

HandlerResult DBus::Interface::handle_call_message ( DBusCxxPointer< Connection connection,
CallMessage::const_pointer  message 
)

Handles the specified call message on the specified connection.

Looks for methods matching the name specified in the message, then calls handle_call_message() for each matching message.

Once a method returns HANDLED no further methods will be tried.

Returns
HANDLED if one method in this interface handled the message, NOT_HANDLED otherwise
Parameters
connThe Connection to send the reply message on
msgThe CallMessage to handle

References DBus::HANDLED, m_methods, m_name, method(), and DBus::NOT_HANDLED.

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

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

References m_methods, and m_methods_rwlock.

bool DBus::Interface::has_signal ( signal_base::pointer  signal) const

True if the given signal is part of this interface.

References m_signals, and m_signals_rwlock.

bool DBus::Interface::has_signal ( const std::string &  name) const

True if this interface has at least one signal with the given name.

References m_signals, m_signals_rwlock, and name().

std::string DBus::Interface::introspect ( int  space_depth = 0) const

Returns a DBus XML description of this interface.

References m_methods, m_signals, and name().

MethodBase::pointer DBus::Interface::method ( const std::string &  name) const

Returns the first method with the given name.

References m_methods, and m_methods_rwlock.

Referenced by add_method(), create_method(), handle_call_message(), on_method_name_changed(), and remove_method().

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

Returns the methods associated with this interface.

References m_methods.

const std::string & DBus::Interface::name ( ) const

Get the name of this interface.

References m_name.

Referenced by add_signal(), has_signal(), introspect(), remove_signal(), and set_connection().

Object * DBus::Interface::object ( ) const

Returns the object associated with this interface.

Note that there is no set_object() method as an interface must be added to an object through the object's add_interface() method.

References m_object.

Referenced by set_object().

void DBus::Interface::on_method_name_changed ( const std::string &  oldname,
const std::string &  newname,
MethodBase::pointer  method 
)
protected

Callback point that updates the method name map when a method changes its name.

References m_method_signal_name_connections, m_methods, m_methods_rwlock, and method().

Referenced by add_method().

Path DBus::Interface::path ( ) const

Returns the path of the object associated with this interface or a null string if no object is associated.

References m_object.

Referenced by add_signal().

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

Removes the first method with the given name.

References m_method_signal_name_connections, m_methods, m_methods_rwlock, m_signal_method_removed, and method().

bool DBus::Interface::remove_signal ( signal_base::pointer  signal)

Removes the given signal.

Returns
true if the signal was successfully removed, false otherwise

One reason a signal couldn't be removed is if it wasn't a part of the interface.

References m_signals, and m_signals_rwlock.

bool DBus::Interface::remove_signal ( const std::string &  name)

Removes all signals with the given name.

References m_signals, m_signals_rwlock, and name().

void DBus::Interface::set_connection ( DBusCxxPointer< Connection conn)
protected

References m_signals, and name().

void DBus::Interface::set_name ( const std::string &  new_name)

Sets the name of this interface.

void DBus::Interface::set_object ( Object object)
protected

References m_object, m_signals, and object().

void DBus::Interface::set_path ( const std::string &  new_path)
protected

References m_signals.

signal_base::pointer DBus::Interface::signal ( const std::string &  signal_name)

Returns the first signal found with a matching name.

If more than one signal has a given name there are no guarantees as to which signal will be returned.

References m_signals, and m_signals_rwlock.

sigc::signal< void, MethodBase::pointer > DBus::Interface::signal_method_added ( )

Signal emitted when a method of the given name is added.

References m_signal_method_added.

sigc::signal< void, MethodBase::pointer > DBus::Interface::signal_method_removed ( )

Signal emitted when a method of the given name is removed.

References m_signal_method_removed.

sigc::signal< void, const std::string &, const std::string & > DBus::Interface::signal_name_changed ( )

Signal emitted when the name is changed.

References m_signal_name_changed.

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

Returns the signals associated with this interface.

References m_signals.

Friends And Related Function Documentation

friend class Object
friend

Member Data Documentation

MethodSignalNameConnections DBus::Interface::m_method_signal_name_connections
protected
Methods DBus::Interface::m_methods
protected
pthread_rwlock_t DBus::Interface::m_methods_rwlock
mutableprotected
std::string DBus::Interface::m_name
protected
pthread_mutex_t DBus::Interface::m_name_mutex
protected

Ensures that the name doesn't change while the name changed signal is emitting.

Referenced by Interface(), and ~Interface().

Object* DBus::Interface::m_object
private

Referenced by connection(), object(), path(), and set_object().

sigc::signal<void,MethodBase::pointer> DBus::Interface::m_signal_method_added
protected

Referenced by add_method(), and signal_method_added().

sigc::signal<void,MethodBase::pointer> DBus::Interface::m_signal_method_removed
protected
sigc::signal<void,const std::string&,const std::string&> DBus::Interface::m_signal_name_changed
protected

Referenced by signal_name_changed().

Signals DBus::Interface::m_signals
protected
pthread_rwlock_t DBus::Interface::m_signals_rwlock
mutableprotected

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

Generated on Sun Mar 19 2017 14:54:27 for dbus-cxx by doxygen 1.8.8