#include <interfaceproxy.h>
Public Types | |
typedef DBusCxxPointer < InterfaceProxy > | pointer |
typedef DBusCxxWeakPointer < InterfaceProxy > | weak_pointer |
typedef std::multimap < std::string, MethodProxyBase::pointer > | Methods |
typedef std::set < signal_proxy_base::pointer > | Signals |
Public Member Functions | |
virtual | ~InterfaceProxy () |
ObjectProxy * | object () const |
std::string | path () const |
DBusCxxPointer< Connection > | connection () const |
const std::string & | name () const |
void | set_name (const std::string &new_name) |
const Methods & | methods () const |
MethodProxyBase::pointer | method (const std::string &name) const |
Returns the first method with the given name. | |
template<class T_return , class T_arg1 = nil, class T_arg2 = nil, class T_arg3 = nil, class T_arg4 = nil, class T_arg5 = nil, class T_arg6 = nil, class T_arg7 = nil> | |
DBusCxxPointer< MethodProxy < T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > > | create_method (const std::string &name) |
bool | add_method (MethodProxyBase::pointer method) |
Adds the named method. | |
void | remove_method (const std::string &name) |
Removes the first method with the given name. | |
void | remove_method (MethodProxyBase::pointer method) |
Removed the specific method. | |
bool | has_method (const std::string &name) const |
True if the interface has a method with the given name. | |
bool | has_method (MethodProxyBase::pointer method) const |
True if the interface has the specified method. | |
CallMessage::pointer | create_call_message (const std::string &method_name) const |
ReturnMessage::const_pointer | call (CallMessage::const_pointer, int timeout_milliseconds=-1) const |
PendingCall::pointer | call_async (CallMessage::const_pointer, int timeout_milliseconds=-1) const |
template<class T_return , class T_arg1 = nil, class T_arg2 = nil, class T_arg3 = nil, class T_arg4 = nil, class T_arg5 = nil, class T_arg6 = nil, class T_arg7 = nil> | |
DBusCxxPointer< signal_proxy < T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > > | create_signal (const std::string &sig_name) |
const Signals & | signals () const |
signal_proxy_base::pointer | signal (const std::string &signame) |
bool | add_signal (signal_proxy_base::pointer sig) |
bool | remove_signal (const std::string &signame) |
bool | remove_signal (signal_proxy_base::pointer sig) |
bool | has_signal (const std::string &signame) const |
bool | has_signal (signal_proxy_base::pointer sig) const |
sigc::signal< void, const std::string &, const std::string & > | signal_name_changed () |
Signal emitted when the name is changed. | |
sigc::signal< void, MethodProxyBase::pointer > | signal_method_added () |
Signal emitted when a method of the given name is added. | |
sigc::signal< void, MethodProxyBase::pointer > | signal_method_removed () |
Signal emitted when a method of the given name is removed. | |
Static Public Member Functions | |
static pointer | create (const std::string &name=std::string()) |
Protected Types | |
typedef std::map < MethodProxyBase::pointer, sigc::connection > | MethodSignalNameConnections |
Protected Member Functions | |
InterfaceProxy (const std::string &name) | |
void | on_method_name_changed (const std::string &oldname, const std::string &newname, MethodProxyBase::pointer method) |
void | on_object_set_connection (DBusCxxPointer< Connection > conn) |
void | on_object_set_path (const std::string &path) |
Protected Attributes | |
ObjectProxy * | m_object |
std::string | m_name |
Methods | m_methods |
Signals | m_signals |
pthread_rwlock_t | m_methods_rwlock |
pthread_mutex_t | m_name_mutex |
Ensures that the name doesn't change while the name changed signal is emitting. | |
sigc::signal< void, const std::string &, const std::string & > | m_signal_name_changed |
sigc::signal< void, MethodProxyBase::pointer > | m_signal_method_added |
sigc::signal< void, MethodProxyBase::pointer > | m_signal_method_removed |
MethodSignalNameConnections | m_method_signal_name_connections |
Friends | |
class | ObjectProxy |
typedef std::multimap<std::string, MethodProxyBase::pointer> DBus::InterfaceProxy::Methods |
typedef std::map<MethodProxyBase::pointer,sigc::connection> DBus::InterfaceProxy::MethodSignalNameConnections [protected] |
typedef DBusCxxPointer<InterfaceProxy> DBus::InterfaceProxy::pointer |
typedef std::set<signal_proxy_base::pointer> DBus::InterfaceProxy::Signals |
typedef DBusCxxWeakPointer<InterfaceProxy> DBus::InterfaceProxy::weak_pointer |
DBus::InterfaceProxy::InterfaceProxy | ( | const std::string & | name | ) | [protected] |
DBus::InterfaceProxy::~InterfaceProxy | ( | ) | [virtual] |
bool DBus::InterfaceProxy::add_method | ( | MethodProxyBase::pointer | method | ) |
Adds the named method.
References has_method(), m_method_signal_name_connections, m_methods, m_methods_rwlock, m_signal_method_added, and on_method_name_changed().
Referenced by create_method().
bool DBus::InterfaceProxy::add_signal | ( | signal_proxy_base::pointer | sig | ) |
ReturnMessage::const_pointer DBus::InterfaceProxy::call | ( | CallMessage::const_pointer | call_message, | |
int | timeout_milliseconds = -1 | |||
) | const |
References m_object.
PendingCall::pointer DBus::InterfaceProxy::call_async | ( | CallMessage::const_pointer | call_message, | |
int | timeout_milliseconds = -1 | |||
) | const |
References m_object.
Connection::pointer DBus::InterfaceProxy::connection | ( | ) | const |
References DBus::ObjectProxy::connection(), and m_object.
Referenced by add_signal(), and remove_signal().
InterfaceProxy::pointer DBus::InterfaceProxy::create | ( | const std::string & | name = std::string() |
) | [static] |
CallMessage::pointer DBus::InterfaceProxy::create_call_message | ( | const std::string & | method_name | ) | const |
DBusCxxPointer<MethodProxy<T_return,T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> > DBus::InterfaceProxy::create_method | ( | const std::string & | name | ) | [inline] |
References add_method(), create(), and method().
DBusCxxPointer<signal_proxy<T_return,T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> > DBus::InterfaceProxy::create_signal | ( | const std::string & | sig_name | ) | [inline] |
References add_signal(), create(), m_name, and path().
bool DBus::InterfaceProxy::has_method | ( | MethodProxyBase::pointer | method | ) | const |
bool DBus::InterfaceProxy::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.
Referenced by add_method().
bool DBus::InterfaceProxy::has_signal | ( | signal_proxy_base::pointer | sig | ) | const |
References m_signals.
bool DBus::InterfaceProxy::has_signal | ( | const std::string & | signame | ) | const |
MethodProxyBase::pointer DBus::InterfaceProxy::method | ( | const std::string & | name | ) | const |
Returns the first method with the given name.
References m_methods, and m_methods_rwlock.
Referenced by create_method(), and remove_method().
const InterfaceProxy::Methods & DBus::InterfaceProxy::methods | ( | ) | const |
References m_methods.
const std::string & DBus::InterfaceProxy::name | ( | ) | const |
ObjectProxy * DBus::InterfaceProxy::object | ( | ) | const |
References m_object.
void DBus::InterfaceProxy::on_method_name_changed | ( | const std::string & | oldname, | |
const std::string & | newname, | |||
MethodProxyBase::pointer | method | |||
) | [protected] |
References m_method_signal_name_connections, m_methods, and m_methods_rwlock.
Referenced by add_method().
void DBus::InterfaceProxy::on_object_set_connection | ( | DBusCxxPointer< Connection > | conn | ) | [protected] |
References m_signals.
void DBus::InterfaceProxy::on_object_set_path | ( | const std::string & | path | ) | [protected] |
References m_signals.
std::string DBus::InterfaceProxy::path | ( | ) | const |
References m_object, and DBus::ObjectProxy::path().
Referenced by add_signal(), and create_signal().
void DBus::InterfaceProxy::remove_method | ( | MethodProxyBase::pointer | method | ) |
Removed the specific method.
References m_method_signal_name_connections, m_methods, m_methods_rwlock, and m_signal_method_removed.
void DBus::InterfaceProxy::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::InterfaceProxy::remove_signal | ( | signal_proxy_base::pointer | sig | ) |
References connection(), has_signal(), and m_signals.
bool DBus::InterfaceProxy::remove_signal | ( | const std::string & | signame | ) |
References signal().
void DBus::InterfaceProxy::set_name | ( | const std::string & | new_name | ) |
References m_name, m_name_mutex, and m_signal_name_changed.
signal_proxy_base::pointer DBus::InterfaceProxy::signal | ( | const std::string & | signame | ) |
sigc::signal< void, MethodProxyBase::pointer > DBus::InterfaceProxy::signal_method_added | ( | ) |
sigc::signal< void, MethodProxyBase::pointer > DBus::InterfaceProxy::signal_method_removed | ( | ) |
sigc::signal< void, const std::string &, const std::string & > DBus::InterfaceProxy::signal_name_changed | ( | ) |
const InterfaceProxy::Signals & DBus::InterfaceProxy::signals | ( | ) | const |
References m_signals.
friend class ObjectProxy [friend] |
Referenced by add_method(), on_method_name_changed(), and remove_method().
Methods DBus::InterfaceProxy::m_methods [protected] |
Referenced by add_method(), has_method(), method(), methods(), on_method_name_changed(), and remove_method().
pthread_rwlock_t DBus::InterfaceProxy::m_methods_rwlock [mutable, protected] |
Referenced by add_method(), has_method(), InterfaceProxy(), method(), on_method_name_changed(), and remove_method().
std::string DBus::InterfaceProxy::m_name [protected] |
Referenced by create_call_message(), create_signal(), name(), and set_name().
pthread_mutex_t DBus::InterfaceProxy::m_name_mutex [protected] |
Ensures that the name doesn't change while the name changed signal is emitting.
Referenced by InterfaceProxy(), and set_name().
ObjectProxy* DBus::InterfaceProxy::m_object [protected] |
Referenced by call(), call_async(), connection(), create_call_message(), object(), and path().
sigc::signal<void,MethodProxyBase::pointer> DBus::InterfaceProxy::m_signal_method_added [protected] |
Referenced by add_method(), and signal_method_added().
sigc::signal<void,MethodProxyBase::pointer> DBus::InterfaceProxy::m_signal_method_removed [protected] |
Referenced by remove_method(), and signal_method_removed().
sigc::signal<void,const std::string&,const std::string&> DBus::InterfaceProxy::m_signal_name_changed [protected] |
Referenced by set_name(), and signal_name_changed().
Signals DBus::InterfaceProxy::m_signals [protected] |
Referenced by add_signal(), has_signal(), on_object_set_connection(), on_object_set_path(), remove_signal(), signal(), and signals().