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

Connection point to the DBus. More...

#include <connection.h>

Public Types

typedef DBusCxxPointer
< Connection
pointer
typedef DBusCxxWeakPointer
< Connection
weak_pointer
typedef sigc::signal1< bool,
Watch::pointer,
InterruptablePredicateAccumulatorDefaultFalse
AddWatchSignal
typedef sigc::signal1< bool,
Timeout::pointer,
InterruptablePredicateAccumulatorDefaultFalse
AddTimeoutSignal
typedef std::deque
< Watch::pointer
Watches
typedef std::list
< signal_proxy_base::pointer
ProxySignals
typedef std::map< std::string,
ProxySignals
NameToProxySignalMap
typedef std::map< std::string,
NameToProxySignalMap
InterfaceToNameProxySignalMap

Public Member Functions

virtual ~Connection ()
 operator bool () const
 True if this is a valid connection; false otherwise.
bool is_valid () const
 True if this is a valid connection; false otherwise.
bool is_private () const
 True if this is a valid connection and is private; false otherwise.
bool bus_register ()
 Registers this connection with the bus.
bool is_registered () const
 True if this connection is already registered.
const char * unique_name () const
 Gets the unique name of the connection as assigned by the message bus.
unsigned long unix_user (const std::string &name) const
 The unix user id associated with the name connection or -1 if an error occurred.
const char * bus_id () const
 The bus' globally unique ID, as described in the D-Bus specification.
int request_name (const std::string &name, unsigned int flags=0)
int release_name (const std::string &name)
bool name_has_owner (const std::string &name) const
StartReply start_service (const std::string &name, uint32_t flags) const
bool add_match (const std::string &rule)
void add_match_nonblocking (const std::string &rule)
bool remove_match (const std::string &rule)
void remove_match_nonblocking (const std::string &rule)
bool is_connected () const
bool is_authenticated () const
bool is_anonymous () const
const char * server_id () const
uint32_t send (const Message::const_pointer)
Connectionoperator<< (Message::const_pointer msg)
 Sends the message on the connection.
PendingCall::pointer send_with_reply_async (Message::const_pointer message, int timeout_milliseconds=-1) const
ReturnMessage::const_pointer send_with_reply_blocking (Message::const_pointer msg, int timeout_milliseconds=-1) const
void flush ()
bool read_write_dispatch (int timeout_milliseconds=-1)
bool read_write (int timeout_milliseconds=-1)
Message::pointer borrow_message ()
void return_message (Message::pointer message)
void steal_borrowed_message (Message::pointer message)
Message::pointer pop_message ()
DispatchStatus dispatch_status () const
DispatchStatus dispatch ()
int unix_fd () const
int socket () const
unsigned long unix_user () const
unsigned long unix_process_id () const
void set_allow_anonymous (bool allow=true)
void set_route_peer_messages (bool route=true)
void set_max_message_size (long size)
long max_message_size ()
void set_max_received_size (long size)
long max_received_size ()
long outgoing_size ()
bool has_messages_to_send ()
AddWatchSignalsignal_add_watch ()
 Cannot call watch.handle() in a slot connected to this signal.
sigc::signal< bool,
Watch::pointer > & 
signal_remove_watch ()
sigc::signal< bool,
Watch::pointer > & 
signal_watch_toggled ()
AddTimeoutSignalsignal_add_timeout ()
 Cannot call timeout.handle() in a slot connected to this signal.
sigc::signal< bool,
Timeout::pointer > & 
signal_remove_timeout ()
sigc::signal< bool,
Timeout::pointer > & 
signal_timeout_toggled ()
sigc::signal< void > & signal_wakeup_main ()
sigc::signal< void,
DispatchStatus > & 
signal_dispatch_status_changed ()
 Cannot call dispatch() in a slot connected to this signal.
FilterSignalsignal_filter ()
 Signal emitted during dispatch.
const Watchesunhandled_watches () const
void remove_unhandled_watch (const Watch::pointer w)
Object::pointer create_object (const std::string &path, PrimaryFallback pf=PRIMARY)
bool register_object (Object::pointer object)
ObjectPathHandler::pointer create_object (const std::string &path, sigc::slot< HandlerResult, Connection::pointer, Message::const_pointer > &slot, PrimaryFallback pf=PRIMARY)
ObjectPathHandler::pointer create_object (const std::string &path, HandlerResult(*MessageFunction)(Connection::pointer, Message::const_pointer), PrimaryFallback pf=PRIMARY)
ObjectProxy::pointer create_object_proxy (const std::string &path)
ObjectProxy::pointer create_object_proxy (const std::string &destination, const std::string &path)
bool unregister_object (const std::string &path)
signal_proxy_simple::pointer create_signal_proxy (const std::string &interface, const std::string &name)
 Adds a signal with the given interface and name.
signal_proxy_simple::pointer create_signal_proxy (const std::string &path, const std::string &interface, const std::string &name)
 Adds a signal with the given path, interface and name.
template<class T_return >
DBusCxxPointer< signal_proxy
< T_return > > 
create_signal_proxy (const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1 > > 
create_signal_proxy (const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1, T_arg2 > > 
create_signal_proxy (const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1, T_arg2,
T_arg3 > > 
create_signal_proxy (const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4 > > 
create_signal_proxy (const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5 > > 
create_signal_proxy (const std::string &interface, const std::string &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_proxy
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6 > > 
create_signal_proxy (const std::string &interface, const std::string &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_proxy
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6,
T_arg7 > > 
create_signal_proxy (const std::string &interface, const std::string &name)
template<class T_return >
DBusCxxPointer< signal_proxy
< T_return > > 
create_signal_proxy (const std::string &path, const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1 > > 
create_signal_proxy (const std::string &path, const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1, T_arg2 > > 
create_signal_proxy (const std::string &path, const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1, T_arg2,
T_arg3 > > 
create_signal_proxy (const std::string &path, const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4 > > 
create_signal_proxy (const std::string &path, const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer< signal_proxy
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5 > > 
create_signal_proxy (const std::string &path, const std::string &interface, const std::string &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_proxy
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6 > > 
create_signal_proxy (const std::string &path, const std::string &interface, const std::string &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_proxy
< T_return, T_arg1, T_arg2,
T_arg3, T_arg4, T_arg5, T_arg6,
T_arg7 > > 
create_signal_proxy (const std::string &path, const std::string &interface, const std::string &name)
signal_proxy_base::pointer add_signal_proxy (signal_proxy_base::pointer signal)
 Adds the given signal proxy to the connection.
bool remove_signal_proxy (signal_proxy_base::pointer proxy)
const
InterfaceToNameProxySignalMap
get_signal_proxies ()
 Gets all the signal handlers.
NameToProxySignalMap get_signal_proxies (const std::string &interface)
 Gets the signal handlers for a specific interface.
ProxySignals get_signal_proxies (const std::string &interface, const std::string &member)
 Gets the signal handlers for a specific interface and member.
template<class T_return >
DBusCxxPointer< signal
< T_return > > 
create_signal (const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 >
DBusCxxPointer< signal
< T_return, T_arg1 > > 
create_signal (const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< signal
< T_return, T_arg1, T_arg2 > > 
create_signal (const std::string &interface, const std::string &name)
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 &interface, const std::string &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 > > 
create_signal (const std::string &interface, const std::string &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 > > 
create_signal (const std::string &interface, const std::string &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 > > 
create_signal (const std::string &interface, const std::string &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 > > 
create_signal (const std::string &interface, const std::string &name)
template<class T_return >
DBusCxxPointer< signal
< T_return > > 
create_signal (const std::string &path, const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 >
DBusCxxPointer< signal
< T_return, T_arg1 > > 
create_signal (const std::string &path, const std::string &interface, const std::string &name)
template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer< signal
< T_return, T_arg1, T_arg2 > > 
create_signal (const std::string &path, const std::string &interface, const std::string &name)
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 &path, const std::string &interface, const std::string &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 > > 
create_signal (const std::string &path, const std::string &interface, const std::string &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 > > 
create_signal (const std::string &path, const std::string &interface, const std::string &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 > > 
create_signal (const std::string &path, const std::string &interface, const std::string &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 > > 
create_signal (const std::string &path, const std::string &interface, const std::string &name)
pointer self ()
 Returns a smart pointer to itself.
DBusConnection * cobj ()
std::string introspect (const std::string &destination, const std::string &path)

Static Public Member Functions

static pointer create (DBusConnection *cobj=NULL, bool is_private=false)
static pointer create (BusType type, bool is_private=false)
 Connects to a bus daemon and registers the client with it.
static pointer create (const Connection &other)
static pointer self (DBusConnection *c)
 Given a dbus connection, if it was established through a call to Connection::create() this method will return a copy of the smart pointer returned by the create method.
static void set_global_change_sigpipe (bool will_modify_sigpipe=true)

Protected Types

typedef std::map< DBusTimeout
*, Timeout::pointer
Timeouts

Protected Member Functions

 Connection (DBusConnection *cobj=NULL, bool is_private=false)
 Connection (BusType type, bool is_private=false)
 Connects to a bus daemon and registers the client with it.
 Connection (const Connection &other)
void initialize (bool is_private)

Static Protected Member Functions

static dbus_bool_t on_add_watch_callback (DBusWatch *cwatch, void *data)
static void on_remove_watch_callback (DBusWatch *cwatch, void *data)
static void on_watch_toggled_callback (DBusWatch *cwatch, void *data)
static dbus_bool_t on_add_timeout_callback (DBusTimeout *ctimeout, void *data)
static void on_remove_timeout_callback (DBusTimeout *ctimeout, void *data)
static void on_timeout_toggled_callback (DBusTimeout *ctimeout, void *data)
static void on_wakeup_main_callback (void *data)
static void on_dispatch_status_callback (DBusConnection *connection, DBusDispatchStatus new_status, void *data)
static DBusHandlerResult on_filter_callback (DBusConnection *connection, DBusMessage *message, void *data)

Protected Attributes

DBusConnection * m_cobj
bool m_private_flag
AddWatchSignal m_add_watch_signal
sigc::signal< bool,
Watch::pointer
m_remove_watch_signal
sigc::signal< bool,
Watch::pointer
m_watch_toggled_signal
AddTimeoutSignal m_add_timeout_signal
sigc::signal< bool,
Timeout::pointer
m_remove_timeout_signal
sigc::signal< bool,
Timeout::pointer
m_timeout_toggled_signal
sigc::signal< void > m_wakeup_main_signal
sigc::signal< void,
DispatchStatus
m_dispatch_status_signal
FilterSignal m_filter_signal
Watches m_unhandled_watches
Timeouts m_timeouts
std::map< std::string,
ObjectPathHandler::pointer > 
m_created_objects
InterfaceToNameProxySignalMap m_proxy_signal_interface_map

Static Protected Attributes

static dbus_int32_t m_weak_pointer_slot = -1

Friends

void init (bool)
 Initializes the dbus-cxx library.

Detailed Description

Connection point to the DBus.

Todo:
TODO need to deal with signal proxies that change name and/or interface
Author
Rick L Vinyard Jr rviny.nosp@m.ard@.nosp@m.cs.nm.nosp@m.su.e.nosp@m.du

Member Typedef Documentation

typedef DBusCxxPointer<Connection> DBus::Connection::pointer
typedef std::map<DBusTimeout*,Timeout::pointer> DBus::Connection::Timeouts
protected
typedef DBusCxxWeakPointer<Connection> DBus::Connection::weak_pointer

Constructor & Destructor Documentation

DBus::Connection::Connection ( DBusConnection *  cobj = NULL,
bool  is_private = false 
)
protected

References initialize(), and m_cobj.

Referenced by create().

DBus::Connection::Connection ( BusType  type,
bool  is_private = false 
)
protected

Connects to a bus daemon and registers the client with it.

Parameters
is_privateif true a private connection will be created. Otherwise a shared connection is created.

References DBus::BUS_NONE, create(), initialize(), and m_cobj.

DBus::Connection::Connection ( const Connection other)
protected

References m_cobj.

DBus::Connection::~Connection ( )
virtual

References is_private(), is_valid(), and m_cobj.

Member Function Documentation

bool DBus::Connection::add_match ( const std::string &  rule)

References create(), is_valid(), and m_cobj.

Referenced by add_signal_proxy().

void DBus::Connection::add_match_nonblocking ( const std::string &  rule)

References is_valid(), and m_cobj.

signal_proxy_base::pointer DBus::Connection::add_signal_proxy ( signal_proxy_base::pointer  signal)

Adds the given signal proxy to the connection.

References add_match(), DBUS_CXX_DEBUG, m_proxy_signal_interface_map, and DBus::signal_base::name().

Referenced by create_signal_proxy().

Message::pointer DBus::Connection::borrow_message ( )

References create(), is_valid(), and m_cobj.

const char * DBus::Connection::bus_id ( ) const

The bus' globally unique ID, as described in the D-Bus specification.

References create(), is_valid(), and m_cobj.

bool DBus::Connection::bus_register ( )

Registers this connection with the bus.

References create(), is_valid(), and m_cobj.

DBusConnection * DBus::Connection::cobj ( )

References m_cobj.

Referenced by self().

Connection::pointer DBus::Connection::create ( DBusConnection *  cobj = NULL,
bool  is_private = false 
)
static
Connection::pointer DBus::Connection::create ( BusType  type,
bool  is_private = false 
)
static

Connects to a bus daemon and registers the client with it.

Parameters
is_privateif true a private connection will be created. Otherwise a shared connection is created.

References DBus::conn_wp_deleter(), Connection(), create(), and m_weak_pointer_slot.

Connection::pointer DBus::Connection::create ( const Connection other)
static
Object::pointer DBus::Connection::create_object ( const std::string &  path,
PrimaryFallback  pf = PRIMARY 
)

References create(), and m_created_objects.

ObjectPathHandler::pointer DBus::Connection::create_object ( const std::string &  path,
sigc::slot< HandlerResult, Connection::pointer, Message::const_pointer > &  slot,
PrimaryFallback  pf = PRIMARY 
)

References create(), and m_created_objects.

ObjectPathHandler::pointer DBus::Connection::create_object ( const std::string &  path,
HandlerResult(*)(Connection::pointer, Message::const_pointer MessageFunction,
PrimaryFallback  pf = PRIMARY 
)

References create(), and m_created_objects.

ObjectProxy::pointer DBus::Connection::create_object_proxy ( const std::string &  path)

References create().

ObjectProxy::pointer DBus::Connection::create_object_proxy ( const std::string &  destination,
const std::string &  path 
)

References create().

template<class T_return >
DBusCxxPointer<signal<T_return> > DBus::Connection::create_signal ( const std::string &  interface,
const std::string &  name 
)
inline

References create().

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

References create().

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

References create().

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

References create().

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::Connection::create_signal ( const std::string &  interface,
const std::string &  name 
)
inline

References create().

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::Connection::create_signal ( const std::string &  interface,
const std::string &  name 
)
inline

References create().

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::Connection::create_signal ( const std::string &  interface,
const std::string &  name 
)
inline

References create().

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::Connection::create_signal ( const std::string &  interface,
const std::string &  name 
)
inline

References create().

template<class T_return >
DBusCxxPointer<signal<T_return> > DBus::Connection::create_signal ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References create().

template<class T_return , class T_arg1 >
DBusCxxPointer<signal<T_return, T_arg1> > DBus::Connection::create_signal ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References create().

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

References create().

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

References create().

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::Connection::create_signal ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References create().

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::Connection::create_signal ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References create().

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::Connection::create_signal ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References create().

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::Connection::create_signal ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References create().

signal_proxy_simple::pointer DBus::Connection::create_signal_proxy ( const std::string &  interface,
const std::string &  name 
)

Adds a signal with the given interface and name.

Returns
Smart pointer to the newly added signal or a null smart pointer if it couldn't be added

References add_signal_proxy(), and DBus::signal_proxy_simple::create().

signal_proxy_simple::pointer DBus::Connection::create_signal_proxy ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)

Adds a signal with the given path, interface and name.

Returns
Smart pointer to the newly added signal or a null smart pointer if it couldn't be added

References add_signal_proxy(), and DBus::signal_proxy_simple::create().

template<class T_return >
DBusCxxPointer<signal_proxy<T_return> > DBus::Connection::create_signal_proxy ( const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 >
DBusCxxPointer<signal_proxy<T_return, T_arg1> > DBus::Connection::create_signal_proxy ( const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2> > DBus::Connection::create_signal_proxy ( const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2,T_arg3> > DBus::Connection::create_signal_proxy ( const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2,T_arg3,T_arg4> > DBus::Connection::create_signal_proxy ( const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> > DBus::Connection::create_signal_proxy ( const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> > DBus::Connection::create_signal_proxy ( const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

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_proxy<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> > DBus::Connection::create_signal_proxy ( const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return >
DBusCxxPointer<signal_proxy<T_return> > DBus::Connection::create_signal_proxy ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 >
DBusCxxPointer<signal_proxy<T_return, T_arg1> > DBus::Connection::create_signal_proxy ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2> > DBus::Connection::create_signal_proxy ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2,T_arg3> > DBus::Connection::create_signal_proxy ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2,T_arg3,T_arg4> > DBus::Connection::create_signal_proxy ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> > DBus::Connection::create_signal_proxy ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

template<class T_return , class T_arg1 , class T_arg2 , class T_arg3 , class T_arg4 , class T_arg5 , class T_arg6 >
DBusCxxPointer<signal_proxy<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> > DBus::Connection::create_signal_proxy ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

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_proxy<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> > DBus::Connection::create_signal_proxy ( const std::string &  path,
const std::string &  interface,
const std::string &  name 
)
inline

References add_signal_proxy(), and create().

DispatchStatus DBus::Connection::dispatch ( )
DispatchStatus DBus::Connection::dispatch_status ( ) const
void DBus::Connection::flush ( )

References is_valid(), and m_cobj.

Referenced by introspect().

const Connection::InterfaceToNameProxySignalMap & DBus::Connection::get_signal_proxies ( )

Gets all the signal handlers.

References m_proxy_signal_interface_map.

Connection::NameToProxySignalMap DBus::Connection::get_signal_proxies ( const std::string &  interface)

Gets the signal handlers for a specific interface.

References m_proxy_signal_interface_map.

Connection::ProxySignals DBus::Connection::get_signal_proxies ( const std::string &  interface,
const std::string &  member 
)

Gets the signal handlers for a specific interface and member.

References m_proxy_signal_interface_map.

bool DBus::Connection::has_messages_to_send ( )

References is_valid(), and m_cobj.

void DBus::Connection::initialize ( bool  is_private)
protected
std::string DBus::Connection::introspect ( const std::string &  destination,
const std::string &  path 
)
bool DBus::Connection::is_anonymous ( ) const

References is_valid(), and m_cobj.

bool DBus::Connection::is_authenticated ( ) const

References is_valid(), and m_cobj.

bool DBus::Connection::is_connected ( ) const

References is_valid(), and m_cobj.

bool DBus::Connection::is_private ( ) const

True if this is a valid connection and is private; false otherwise.

References m_private_flag.

Referenced by initialize(), and ~Connection().

bool DBus::Connection::is_registered ( ) const

True if this connection is already registered.

References unique_name().

bool DBus::Connection::is_valid ( ) const
long DBus::Connection::max_message_size ( )

References is_valid(), and m_cobj.

long DBus::Connection::max_received_size ( )

References is_valid(), and m_cobj.

bool DBus::Connection::name_has_owner ( const std::string &  name) const

References create(), is_valid(), and m_cobj.

dbus_bool_t DBus::Connection::on_add_timeout_callback ( DBusTimeout *  ctimeout,
void *  data 
)
staticprotected
dbus_bool_t DBus::Connection::on_add_watch_callback ( DBusWatch *  cwatch,
void *  data 
)
staticprotected

References create(), m_unhandled_watches, and signal_add_watch().

Referenced by initialize().

void DBus::Connection::on_dispatch_status_callback ( DBusConnection *  connection,
DBusDispatchStatus  new_status,
void *  data 
)
staticprotected

References signal_dispatch_status_changed().

Referenced by initialize().

DBusHandlerResult DBus::Connection::on_filter_callback ( DBusConnection *  connection,
DBusMessage *  message,
void *  data 
)
staticprotected
void DBus::Connection::on_remove_timeout_callback ( DBusTimeout *  ctimeout,
void *  data 
)
staticprotected
void DBus::Connection::on_remove_watch_callback ( DBusWatch *  cwatch,
void *  data 
)
staticprotected

References DBus::Watch::create(), and signal_remove_watch().

Referenced by initialize().

void DBus::Connection::on_timeout_toggled_callback ( DBusTimeout *  ctimeout,
void *  data 
)
staticprotected
void DBus::Connection::on_wakeup_main_callback ( void *  data)
staticprotected

References signal_wakeup_main().

Referenced by initialize().

void DBus::Connection::on_watch_toggled_callback ( DBusWatch *  cwatch,
void *  data 
)
staticprotected
DBus::Connection::operator bool ( ) const

True if this is a valid connection; false otherwise.

Connection & DBus::Connection::operator<< ( Message::const_pointer  msg)

Sends the message on the connection.

References send().

long DBus::Connection::outgoing_size ( )

References is_valid(), and m_cobj.

Message::pointer DBus::Connection::pop_message ( )

References create(), is_valid(), and m_cobj.

bool DBus::Connection::read_write ( int  timeout_milliseconds = -1)

References is_valid(), and m_cobj.

bool DBus::Connection::read_write_dispatch ( int  timeout_milliseconds = -1)

References is_valid(), and m_cobj.

bool DBus::Connection::register_object ( Object::pointer  object)

References DBUS_CXX_DEBUG.

int DBus::Connection::release_name ( const std::string &  name)

References create(), is_valid(), and m_cobj.

bool DBus::Connection::remove_match ( const std::string &  rule)

References create(), is_valid(), and m_cobj.

Referenced by remove_signal_proxy().

void DBus::Connection::remove_match_nonblocking ( const std::string &  rule)

References is_valid(), and m_cobj.

bool DBus::Connection::remove_signal_proxy ( signal_proxy_base::pointer  proxy)
void DBus::Connection::remove_unhandled_watch ( const Watch::pointer  w)

References m_unhandled_watches.

int DBus::Connection::request_name ( const std::string &  name,
unsigned int  flags = 0 
)

References create(), is_valid(), and m_cobj.

void DBus::Connection::return_message ( Message::pointer  message)

References is_valid(), and m_cobj.

Connection::pointer DBus::Connection::self ( )

Returns a smart pointer to itself.

References cobj(), is_valid(), and m_weak_pointer_slot.

Referenced by DBus::MessageHandler::message_handler_callback().

Connection::pointer DBus::Connection::self ( DBusConnection *  c)
static

Given a dbus connection, if it was established through a call to Connection::create() this method will return a copy of the smart pointer returned by the create method.

This is accomplished safely because the create() methods store a weak pointer in a dbus data slot associated with the DBusConnection C object, and this method creates the smart pointer from the weak pointer if the weak pointer is still valid.

If the DBusConnection was created outside a Connection::create() method or the underlying object has already been deleted this method will return an empty pointer.

References m_weak_pointer_slot.

uint32_t DBus::Connection::send ( const Message::const_pointer  msg)

References create(), is_valid(), and m_cobj.

Referenced by operator<<().

PendingCall::pointer DBus::Connection::send_with_reply_async ( Message::const_pointer  message,
int  timeout_milliseconds = -1 
) const

References create(), is_valid(), and m_cobj.

Referenced by introspect().

ReturnMessage::const_pointer DBus::Connection::send_with_reply_blocking ( Message::const_pointer  msg,
int  timeout_milliseconds = -1 
) const

References create(), is_valid(), and m_cobj.

const char * DBus::Connection::server_id ( ) const

References is_valid(), and m_cobj.

void DBus::Connection::set_allow_anonymous ( bool  allow = true)

References is_valid(), and m_cobj.

void DBus::Connection::set_global_change_sigpipe ( bool  will_modify_sigpipe = true)
static
void DBus::Connection::set_max_message_size ( long  size)

References is_valid(), and m_cobj.

void DBus::Connection::set_max_received_size ( long  size)

References is_valid(), and m_cobj.

void DBus::Connection::set_route_peer_messages ( bool  route = true)

References is_valid(), and m_cobj.

Connection::AddTimeoutSignal & DBus::Connection::signal_add_timeout ( )

Cannot call timeout.handle() in a slot connected to this signal.

References m_add_timeout_signal.

Referenced by on_add_timeout_callback().

Connection::AddWatchSignal & DBus::Connection::signal_add_watch ( )

Cannot call watch.handle() in a slot connected to this signal.

References m_add_watch_signal.

Referenced by on_add_watch_callback().

sigc::signal< void, DispatchStatus > & DBus::Connection::signal_dispatch_status_changed ( )

Cannot call dispatch() in a slot connected to this signal.

References m_dispatch_status_signal.

Referenced by on_dispatch_status_callback().

FilterSignal & DBus::Connection::signal_filter ( )

Signal emitted during dispatch.

A slot returning true will cause the message to be filtered.

References m_filter_signal.

sigc::signal< bool, Timeout::pointer > & DBus::Connection::signal_remove_timeout ( )
sigc::signal< bool, Watch::pointer > & DBus::Connection::signal_remove_watch ( )
sigc::signal< bool, Timeout::pointer > & DBus::Connection::signal_timeout_toggled ( )
sigc::signal< void > & DBus::Connection::signal_wakeup_main ( )

References m_wakeup_main_signal.

Referenced by on_wakeup_main_callback().

sigc::signal< bool, Watch::pointer > & DBus::Connection::signal_watch_toggled ( )
int DBus::Connection::socket ( ) const

References is_valid(), and m_cobj.

StartReply DBus::Connection::start_service ( const std::string &  name,
uint32_t  flags 
) const
void DBus::Connection::steal_borrowed_message ( Message::pointer  message)

References is_valid(), and m_cobj.

const Connection::Watches & DBus::Connection::unhandled_watches ( ) const

References m_unhandled_watches.

const char * DBus::Connection::unique_name ( ) const

Gets the unique name of the connection as assigned by the message bus.

References is_valid(), and m_cobj.

Referenced by is_registered().

int DBus::Connection::unix_fd ( ) const

References is_valid(), and m_cobj.

unsigned long DBus::Connection::unix_process_id ( ) const

References is_valid(), and m_cobj.

unsigned long DBus::Connection::unix_user ( const std::string &  name) const

The unix user id associated with the name connection or -1 if an error occurred.

References create(), is_valid(), and m_cobj.

unsigned long DBus::Connection::unix_user ( ) const

References is_valid(), and m_cobj.

bool DBus::Connection::unregister_object ( const std::string &  path)

Friends And Related Function Documentation

void init ( bool  )
friend

Initializes the dbus-cxx library.

Parameters
threadsafeIf true the library's threadsafe structures, along with the underlying dbus library will be initialized to support threadsafe operations. This makes the library threadsafe at the cost of efficiency.

Member Data Documentation

AddTimeoutSignal DBus::Connection::m_add_timeout_signal
protected

Referenced by signal_add_timeout().

AddWatchSignal DBus::Connection::m_add_watch_signal
protected

Referenced by signal_add_watch().

DBusConnection* DBus::Connection::m_cobj
protected
std::map<std::string,ObjectPathHandler::pointer> DBus::Connection::m_created_objects
protected

Referenced by create_object().

sigc::signal<void,DispatchStatus> DBus::Connection::m_dispatch_status_signal
protected
FilterSignal DBus::Connection::m_filter_signal
protected

Referenced by signal_filter().

bool DBus::Connection::m_private_flag
protected

Referenced by initialize(), and is_private().

InterfaceToNameProxySignalMap DBus::Connection::m_proxy_signal_interface_map
protected
sigc::signal<bool,Timeout::pointer> DBus::Connection::m_remove_timeout_signal
protected

Referenced by signal_remove_timeout().

sigc::signal<bool,Watch::pointer> DBus::Connection::m_remove_watch_signal
protected

Referenced by signal_remove_watch().

sigc::signal<bool,Timeout::pointer> DBus::Connection::m_timeout_toggled_signal
protected

Referenced by signal_timeout_toggled().

Timeouts DBus::Connection::m_timeouts
protected
Watches DBus::Connection::m_unhandled_watches
protected
sigc::signal<void> DBus::Connection::m_wakeup_main_signal
protected

Referenced by signal_wakeup_main().

sigc::signal<bool,Watch::pointer> DBus::Connection::m_watch_toggled_signal
protected

Referenced by signal_watch_toggled().

dbus_int32_t DBus::Connection::m_weak_pointer_slot = -1
staticprotected

Referenced by create(), DBus::init(), and self().


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

Generated on Sat Sep 21 2013 17:22:40 for dbus-cxx by doxygen 1.8.1.2