#include <object.h>
Inherits DBus::ObjectPathHandler.
Public Types | |
typedef DBusCxxPointer< Object > | pointer |
Typedef to smart pointers to Object. | |
typedef std::multimap < std::string, DBusCxxPointer < Interface > > | Interfaces |
Typedef to the storage structure for an Object instance's interfaces. | |
typedef std::map< std::string, Object::pointer > | Children |
Typedef to storage structure for an Object instance's children. | |
Public Member Functions | |
virtual | ~Object () |
virtual bool | register_with_connection (DBusCxxPointer< Connection > conn) |
Extends base version to include registering signals. | |
const Interfaces & | interfaces () const |
Get all the interfaces associated with this Object instance. | |
DBusCxxPointer< Interface > | interface (const std::string &name) const |
Returns the first interface with the given name. | |
bool | add_interface (DBusCxxPointer< Interface > interface) |
Adds the interface to this object. | |
DBusCxxPointer< Interface > | create_interface (const std::string &name) |
Creates and adds the named interface to this object. | |
template<class T_return > | |
DBusCxxPointer< Method < T_return > > | create_method (const std::string &method_name, sigc::slot0< T_return > slot) |
Creates a method with a signature based on the. | |
template<class T_return , class T_arg1 > | |
DBusCxxPointer< Method < T_return, T_arg1 > > | create_method (const std::string &method_name, sigc::slot1< T_return, T_arg1 > slot) |
Creates a method with a signature based on the. | |
template<class T_return , class T_arg1 , class T_arg2 > | |
DBusCxxPointer< Method < T_return, T_arg1, T_arg2 > > | create_method (const std::string &method_name, sigc::slot2< T_return, T_arg1, T_arg2 > slot) |
Creates a method with a signature based on the. | |
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 &method_name, sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > slot) |
Creates a method with a signature based on the. | |
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 &method_name, sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > slot) |
Creates a method with a signature based on the. | |
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 &method_name, sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > slot) |
Creates a method with a signature based on the. | |
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 &method_name, sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > slot) |
Creates a method with a signature based on the. | |
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 &method_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 based on the. | |
template<class T_return > | |
DBusCxxPointer< Method < T_return > > | create_method (const std::string &interface_name, const std::string &method_name, sigc::slot0< T_return > slot) |
Creates a method with a signature based on the. | |
template<class T_return , class T_arg1 > | |
DBusCxxPointer< Method < T_return, T_arg1 > > | create_method (const std::string &interface_name, const std::string &method_name, sigc::slot1< T_return, T_arg1 > slot) |
Creates a method with a signature based on the. | |
template<class T_return , class T_arg1 , class T_arg2 > | |
DBusCxxPointer< Method < T_return, T_arg1, T_arg2 > > | create_method (const std::string &interface_name, const std::string &method_name, sigc::slot2< T_return, T_arg1, T_arg2 > slot) |
Creates a method with a signature based on the. | |
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 &interface_name, const std::string &method_name, sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > slot) |
Creates a method with a signature based on the. | |
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 &interface_name, const std::string &method_name, sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > slot) |
Creates a method with a signature based on the. | |
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 &interface_name, const std::string &method_name, sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > slot) |
Creates a method with a signature based on the. | |
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 &interface_name, const std::string &method_name, sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > slot) |
Creates a method with a signature based on the. | |
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 &interface_name, const std::string &method_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 based on the. | |
void | remove_interface (const std::string &name) |
Removes the first interface found with the given name. | |
bool | has_interface (const std::string &name) |
Test whether an Object has a named interface. | |
DBusCxxPointer< Interface > | default_interface () const |
Get the default interface associated with this object. | |
bool | set_default_interface (const std::string &new_default_name) |
Set the default interface to a specific name. | |
void | remove_default_interface () |
Removes the currently set (if any) default interface. | |
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 and adds it to the default interface. | |
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 and adds it to the default interface. | |
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 and adds it to the default interface. | |
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 and adds it to the default interface. | |
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 and adds it to the default interface. | |
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 and adds it to the default interface. | |
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 and adds it to the default interface. | |
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 and adds it to the default interface. | |
template<class T_return > | |
DBusCxxPointer< signal < T_return > > | create_signal (const std::string &iface, const std::string &name) |
Creates a signal with a return value (possibly void ) and 0 parameters and adds it to the named interface. | |
template<class T_return , class T_arg1 > | |
DBusCxxPointer< signal < T_return, T_arg1 > > | create_signal (const std::string &iface, const std::string &name) |
Creates a signal with a return value (possibly void ) and 1 parameters and adds it to the named interface. | |
template<class T_return , class T_arg1 , class T_arg2 > | |
DBusCxxPointer< signal < T_return, T_arg1, T_arg2 > > | create_signal (const std::string &iface, const std::string &name) |
Creates a signal with a return value (possibly void ) and 2 parameters and adds it to the named interface. | |
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 &iface, const std::string &name) |
Creates a signal with a return value (possibly void ) and 3 parameters and adds it to the named interface. | |
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 &iface, const std::string &name) |
Creates a signal with a return value (possibly void ) and 4 parameters and adds it to the named interface. | |
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 &iface, const std::string &name) |
Creates a signal with a return value (possibly void ) and 5 parameters and adds it to the named interface. | |
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 &iface, const std::string &name) |
Creates a signal with a return value (possibly void ) and 6 parameters and adds it to the named interface. | |
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 &iface, const std::string &name) |
Creates a signal with a return value (possibly void ) and 7 parameters and adds it to the named interface. | |
const Children & | children () const |
Get the children associated with this object instance. | |
Object::pointer | child (const std::string &name) const |
Get a named child of this object. | |
bool | add_child (const std::string &name, Object::pointer child, bool force=false) |
Add an object as a child with a specified name This method will fail if the object already has a child with the specified name and force is not set. | |
bool | remove_child (const std::string &name) |
Remove the named child from this object. | |
bool | has_child (const std::string &name) const |
Test whether an object has a child with a specified name. | |
std::string | introspect (int space_depth=0) const |
Returns a DBus XML description of this interface. | |
sigc::signal< void, DBusCxxPointer< Interface > > | signal_interface_added () |
Signal emitted when an interface is added to this object. | |
sigc::signal< void, DBusCxxPointer< Interface > > | signal_interface_removed () |
Signal emitted when an interface is removed from this object. | |
sigc::signal< void, DBusCxxPointer< Interface > ,DBusCxxPointer< Interface > > | signal_default_interface_changed () |
Signal emitted when the default interface of this object is changed. | |
virtual HandlerResult | handle_message (DBusCxxPointer< Connection > conn, Message::const_pointer msg) |
Handles the specified message on the specified connection. | |
Static Public Member Functions | |
static pointer | create (const std::string &path=std::string(), PrimaryFallback pf=PRIMARY) |
Creates a named Object that will register as a primary or fallback handler. | |
Protected Types | |
typedef std::map < DBusCxxPointer< Interface > ,sigc::connection > | InterfaceSignalNameConnections |
Protected Member Functions | |
Object (const std::string &path, PrimaryFallback pf=PRIMARY) | |
This class has a protected constructor. | |
void | on_interface_name_changed (const std::string &oldname, const std::string &newname, DBusCxxPointer< Interface > interface) |
Callback point that updates the interface name map when an interface changes its name. | |
Protected Attributes | |
Children | m_children |
pthread_rwlock_t | m_interfaces_rwlock |
pthread_mutex_t | m_name_mutex |
Interfaces | m_interfaces |
DBusCxxPointer< Interface > | m_default_interface |
sigc::signal< void, DBusCxxPointer< Interface > ,DBusCxxPointer< Interface > > | m_signal_default_interface_changed |
sigc::signal< void, DBusCxxPointer< Interface > > | m_signal_interface_added |
sigc::signal< void, DBusCxxPointer< Interface > > | m_signal_interface_removed |
InterfaceSignalNameConnections | m_interface_signal_name_connections |
calculator_server.cpp, callee_object_inherited.cpp, and signal_emitter_object.cpp.
typedef std::map<std::string, Object::pointer> DBus::Object::Children |
Typedef to storage structure for an Object
instance's children.
The key is the child's name and the value
Data Structure - map: an object's children must be uniquely named Key - child name Value -smart pointer to a child object.
Can access type as Object::Children
typedef std::multimap<std::string, DBusCxxPointer<Interface> > DBus::Object::Interfaces |
Typedef to the storage structure for an Object
instance's interfaces.
Data Structure - Multimap: There is no restriction that interfaces must be uniquely named Key - interface name Value -smart pointer to an interface.
Can access type as Object::Interfaces
typedef std::map<DBusCxxPointer<Interface> ,sigc::connection> DBus::Object::InterfaceSignalNameConnections [protected] |
typedef DBusCxxPointer<Object> DBus::Object::pointer |
Typedef to smart pointers to Object.
Can access type as Object::pointer
Reimplemented from DBus::MessageHandler.
DBus::Object::Object | ( | const std::string & | path, | |
PrimaryFallback | pf = PRIMARY | |||
) | [protected] |
This class has a protected constructor.
Use the create()
methods to obtain a smart pointer to a new instance.
References m_interfaces_rwlock, and m_name_mutex.
Referenced by create().
DBus::Object::~Object | ( | ) | [virtual] |
References m_interfaces_rwlock, and m_name_mutex.
bool DBus::Object::add_child | ( | const std::string & | name, | |
Object::pointer | child, | |||
bool | force = false | |||
) |
Add an object as a child with a specified name This method will fail if the object already has a child with the specified name and force
is not set.
True
if the child was successfully added, false
otherwise. name | The name to use for the child. | |
child | A smart pointer to an object to add as a child. | |
force | If true a child with the same name will be replaced. |
References has_child(), and m_children.
bool DBus::Object::add_interface | ( | DBusCxxPointer< Interface > | interface | ) |
Adds the interface to this object.
Referenced by create_interface().
Object::pointer DBus::Object::child | ( | const std::string & | name | ) | const |
Get a named child of this object.
name | The name of the child to return |
References m_children.
const Object::Children & DBus::Object::children | ( | ) | const |
Get the children associated with this object instance.
References m_children.
Object::pointer DBus::Object::create | ( | const std::string & | path = std::string() , |
|
PrimaryFallback | pf = PRIMARY | |||
) | [static] |
Creates a named Object that will register as a primary or fallback handler.
path | The path the object will handle | |
pf | Determines whether the Object will registar as a primary or fallback handler (default = PRIMARY ) |
References Object().
Referenced by create_interface().
Interface::pointer DBus::Object::create_interface | ( | const std::string & | name | ) |
Creates and adds the named interface to this object.
References add_interface(), and create().
Referenced by create_method(), and create_signal().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > > DBus::Object::create_method | ( | const std::string & | interface_name, | |
const std::string & | method_name, | |||
sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the named interface |
slot | This 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 create_interface(), and interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > > DBus::Object::create_method | ( | const std::string & | interface_name, | |
const std::string & | method_name, | |||
sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the named interface |
slot | This 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 create_interface(), and interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > > DBus::Object::create_method | ( | const std::string & | interface_name, | |
const std::string & | method_name, | |||
sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the named interface |
slot | This 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 create_interface(), and interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > > DBus::Object::create_method | ( | const std::string & | interface_name, | |
const std::string & | method_name, | |||
sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the named interface |
slot | This 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 create_interface(), and interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3 > > DBus::Object::create_method | ( | const std::string & | interface_name, | |
const std::string & | method_name, | |||
sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the named interface |
slot | This 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 create_interface(), and interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2 > > DBus::Object::create_method | ( | const std::string & | interface_name, | |
const std::string & | method_name, | |||
sigc::slot2< T_return, T_arg1, T_arg2 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the named interface |
slot | This 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 create_interface(), and interface().
DBusCxxPointer< Method< T_return, T_arg1 > > DBus::Object::create_method | ( | const std::string & | interface_name, | |
const std::string & | method_name, | |||
sigc::slot1< T_return, T_arg1 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the named interface |
slot | This 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 create_interface(), and interface().
DBusCxxPointer< Method< T_return > > DBus::Object::create_method | ( | const std::string & | interface_name, | |
const std::string & | method_name, | |||
sigc::slot0< T_return > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the named interface |
slot | This 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 create_interface(), and interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > > DBus::Object::create_method | ( | const std::string & | method_name, | |
sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the default interface |
slot | This 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 create_interface(), m_default_interface, and set_default_interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > > DBus::Object::create_method | ( | const std::string & | method_name, | |
sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the default interface |
slot | This 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 create_interface(), m_default_interface, and set_default_interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > > DBus::Object::create_method | ( | const std::string & | method_name, | |
sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the default interface |
slot | This 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 create_interface(), m_default_interface, and set_default_interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > > DBus::Object::create_method | ( | const std::string & | method_name, | |
sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the default interface |
slot | This 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 create_interface(), m_default_interface, and set_default_interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2, T_arg3 > > DBus::Object::create_method | ( | const std::string & | method_name, | |
sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the default interface |
slot | This 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 create_interface(), m_default_interface, and set_default_interface().
DBusCxxPointer< Method< T_return, T_arg1, T_arg2 > > DBus::Object::create_method | ( | const std::string & | method_name, | |
sigc::slot2< T_return, T_arg1, T_arg2 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the default interface |
slot | This 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 create_interface(), m_default_interface, and set_default_interface().
DBusCxxPointer< Method< T_return, T_arg1 > > DBus::Object::create_method | ( | const std::string & | method_name, | |
sigc::slot1< T_return, T_arg1 > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the default interface |
slot | This 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 create_interface(), m_default_interface, and set_default_interface().
DBusCxxPointer< Method< T_return > > DBus::Object::create_method | ( | const std::string & | method_name, | |
sigc::slot0< T_return > | slot | |||
) | [inline] |
Creates a method with a signature based on the.
slot | parameter signature and adds it to the default interface |
slot | This 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 create_interface(), m_default_interface, and set_default_interface().
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> > DBus::Object::create_signal | ( | const std::string & | iface, | |
const std::string & | name | |||
) | [inline] |
Creates a signal with a return value (possibly void
) and 7 parameters and adds it to the named interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> > DBus::Object::create_signal | ( | const std::string & | iface, | |
const std::string & | name | |||
) | [inline] |
Creates a signal with a return value (possibly void
) and 6 parameters and adds it to the named interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> > DBus::Object::create_signal | ( | const std::string & | iface, | |
const std::string & | name | |||
) | [inline] |
Creates a signal with a return value (possibly void
) and 5 parameters and adds it to the named interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3,T_arg4> > DBus::Object::create_signal | ( | const std::string & | iface, | |
const std::string & | name | |||
) | [inline] |
Creates a signal with a return value (possibly void
) and 4 parameters and adds it to the named interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3> > DBus::Object::create_signal | ( | const std::string & | iface, | |
const std::string & | name | |||
) | [inline] |
Creates a signal with a return value (possibly void
) and 3 parameters and adds it to the named interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2> > DBus::Object::create_signal | ( | const std::string & | iface, | |
const std::string & | name | |||
) | [inline] |
Creates a signal with a return value (possibly void
) and 2 parameters and adds it to the named interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1> > DBus::Object::create_signal | ( | const std::string & | iface, | |
const std::string & | name | |||
) | [inline] |
Creates a signal with a return value (possibly void
) and 1 parameters and adds it to the named interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer< signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > > DBus::Object::create_signal | ( | const std::string & | iface, | |
const std::string & | name | |||
) | [inline] |
Creates a signal with a return value (possibly void
) and 0 parameters and adds it to the named interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
References create_interface(), has_interface(), and interface().
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> > DBus::Object::create_signal | ( | const std::string & | name | ) | [inline] |
Creates a signal with a return value (possibly void
) and 7 parameters and adds it to the default interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> > DBus::Object::create_signal | ( | const std::string & | name | ) | [inline] |
Creates a signal with a return value (possibly void
) and 6 parameters and adds it to the default interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> > DBus::Object::create_signal | ( | const std::string & | name | ) | [inline] |
Creates a signal with a return value (possibly void
) and 5 parameters and adds it to the default interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3,T_arg4> > DBus::Object::create_signal | ( | const std::string & | name | ) | [inline] |
Creates a signal with a return value (possibly void
) and 4 parameters and adds it to the default interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2,T_arg3> > DBus::Object::create_signal | ( | const std::string & | name | ) | [inline] |
Creates a signal with a return value (possibly void
) and 3 parameters and adds it to the default interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1,T_arg2> > DBus::Object::create_signal | ( | const std::string & | name | ) | [inline] |
Creates a signal with a return value (possibly void
) and 2 parameters and adds it to the default interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer<signal<T_return, T_arg1> > DBus::Object::create_signal | ( | const std::string & | name | ) | [inline] |
Creates a signal with a return value (possibly void
) and 1 parameters and adds it to the default interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
DBusCxxPointer< signal< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > > DBus::Object::create_signal | ( | const std::string & | name | ) | [inline] |
Creates a signal with a return value (possibly void
) and 0 parameters and adds it to the default interface.
Template parameters for the create_signal()
call will determine the signature of the signal created.
References create_interface(), and default_interface().
Interface::pointer DBus::Object::default_interface | ( | ) | const |
Get the default interface associated with this object.
Referenced by create_signal().
virtual HandlerResult DBus::Object::handle_message | ( | DBusCxxPointer< Connection > | conn, | |
Message::const_pointer | msg | |||
) | [virtual] |
Handles the specified message on the specified connection.
If msg
is an introspection message, the object will rely on its introspection()
method to provide a reply.
Looks for interfaces specified in the message first. If the message does not specify an interface or the specified interface is not found the default interface will be used.
If the specified interface is found, all matching interfaces will be tried until an interface handler returns HANDLED
. Once an interface returns HANDLED
no further interfaces will be tried.
If no interface returns HANDLED
the default interface (if one is set) will be tried.
HANDLED
if this object handled the message, NOT_HANDLED
otherwise conn | The Connection to send the reply message on | |
msg | The message to handle; must be a CallMessage or it will not be handled |
Reimplemented from DBus::MessageHandler.
bool DBus::Object::has_child | ( | const std::string & | name | ) | const |
Test whether an object has a child with a specified name.
True
if the object has the named child, false
otherwise. name | The name of the child to test. |
References m_children.
Referenced by add_child().
bool DBus::Object::has_interface | ( | const std::string & | name | ) |
Test whether an Object has a named interface.
True
if the object has the named interface, false
otherwise name | The name of the interface to look for |
References m_interfaces, and m_interfaces_rwlock.
Referenced by create_signal().
Interface::pointer DBus::Object::interface | ( | const std::string & | name | ) | const |
Returns the first interface with the given name.
References m_interfaces, and m_interfaces_rwlock.
Referenced by create_method(), and create_signal().
const Object::Interfaces & DBus::Object::interfaces | ( | ) | const |
Get all the interfaces associated with this Object instance.
References m_interfaces.
std::string DBus::Object::introspect | ( | int | space_depth = 0 |
) | const |
Returns a DBus XML description of this interface.
References DBUS_CXX_INTROSPECTABLE_INTERFACE, m_children, and m_interfaces.
void DBus::Object::on_interface_name_changed | ( | const std::string & | oldname, | |
const std::string & | newname, | |||
DBusCxxPointer< Interface > | interface | |||
) | [protected] |
Callback point that updates the interface name map when an interface changes its name.
virtual bool DBus::Object::register_with_connection | ( | DBusCxxPointer< Connection > | conn | ) | [virtual] |
Extends base version to include registering signals.
bool DBus::Object::remove_child | ( | const std::string & | name | ) |
Remove the named child from this object.
True
if the child was found and removed, false
if no child by the name was found to remove. name | The name of the child to remove. |
References m_children.
void DBus::Object::remove_default_interface | ( | ) |
Removes the currently set (if any) default interface.
There wil not be a default interface set.
References m_signal_default_interface_changed.
void DBus::Object::remove_interface | ( | const std::string & | name | ) |
Removes the first interface found with the given name.
References m_interface_signal_name_connections, m_interfaces, m_interfaces_rwlock, m_signal_default_interface_changed, and m_signal_interface_removed.
bool DBus::Object::set_default_interface | ( | const std::string & | new_default_name | ) |
Set the default interface to a specific name.
The first interface found with a matching name is used. If there is already a default interface set it will be replaced.
True
if an interface with the specified name was found, false
otherwise. new_default_name | The name of the interface to use as the default. |
References m_interfaces, m_interfaces_rwlock, and m_signal_default_interface_changed.
Referenced by create_method().
sigc::signal< void, Interface::pointer, Interface::pointer > DBus::Object::signal_default_interface_changed | ( | ) |
Signal emitted when the default interface of this object is changed.
The first parameter of the callback is a pointer to the old default interface, and the second parameter is a callback to the new default interface.
References m_signal_default_interface_changed.
sigc::signal< void, Interface::pointer > DBus::Object::signal_interface_added | ( | ) |
Signal emitted when an interface is added to this object.
The first parameter of the callback is a pointer to the newly added interface.
References m_signal_interface_added.
sigc::signal< void, Interface::pointer > DBus::Object::signal_interface_removed | ( | ) |
Signal emitted when an interface is removed from this object.
The first parameter of the callback is a pointer to the removed interface.
References m_signal_interface_removed.
Children DBus::Object::m_children [protected] |
Referenced by add_child(), child(), children(), has_child(), introspect(), and remove_child().
DBusCxxPointer<Interface> DBus::Object::m_default_interface [protected] |
Referenced by create_method().
Referenced by remove_interface().
Interfaces DBus::Object::m_interfaces [protected] |
Referenced by has_interface(), interface(), interfaces(), introspect(), remove_interface(), and set_default_interface().
pthread_rwlock_t DBus::Object::m_interfaces_rwlock [mutable, protected] |
Referenced by has_interface(), interface(), Object(), remove_interface(), set_default_interface(), and ~Object().
pthread_mutex_t DBus::Object::m_name_mutex [protected] |
sigc::signal<void,DBusCxxPointer<Interface> ,DBusCxxPointer<Interface> > DBus::Object::m_signal_default_interface_changed [protected] |
sigc::signal<void,DBusCxxPointer<Interface> > DBus::Object::m_signal_interface_added [protected] |
Referenced by signal_interface_added().
sigc::signal<void,DBusCxxPointer<Interface> > DBus::Object::m_signal_interface_removed [protected] |
Referenced by remove_interface(), and signal_interface_removed().