DBus_Server Class Reference

#include <dbus_server.h>

List of all members.

Public Member Functions

 DBus_Server ()
 ~DBus_Server ()

Static Public Member Functions

static DBusConnection * openSystemConnection ()
 Opens a new connection to the system bus, tries to register the service and returns a filedescriptor to watch for.
static int emitSignal (const char *signal, const char *value)
 emits a signal over the system bus
static bool sendMethodCall (const char *interface, const char *path, const char *object, const char *method)
 send a method call over the bus
static bool serviceHasOwner (const std::string &service)
 check if a service is registered on the bus
static gboolean dbus_reconnect ()
 tries to reconnect to the dbus service

Static Public Attributes

static DBusConnection * _connection = NULL

Static Private Member Functions

static DBusHandlerResult filter_function (DBusConnection *conn, DBusMessage *msg, void *data)
 checking of interfaces is done here in filter function checking for the right member, message contents, etc. must be done in pm->handleDBusRequest(..) Create the Message here, we must send a reply (sendReply(), there the memory for the reply will be freed again.
static void sendReply (DBusMessage *reply, int error_id)


Constructor & Destructor Documentation

DBus_Server::DBus_Server  ) 
 

DBus_Server::~DBus_Server  ) 
 


Member Function Documentation

gboolean DBus_Server::dbus_reconnect  )  [static]
 

tries to reconnect to the dbus service

declared static to be used as callback function in main loop

int DBus_Server::emitSignal const char *  signal,
const char *  value
[static]
 

emits a signal over the system bus

Parameters:
signal the signal to emit
value the value of the signal
Returns:
DBUS_ERROR

DBusHandlerResult DBus_Server::filter_function DBusConnection *  conn,
DBusMessage *  msg,
void *  data
[static, private]
 

checking of interfaces is done here in filter function checking for the right member, message contents, etc. must be done in pm->handleDBusRequest(..) Create the Message here, we must send a reply (sendReply(), there the memory for the reply will be freed again.

Todo:
This means DBus daemon itself threw us out, Need to disconnect gracefully and free all resources
Todo:
HANDLED or NOT_YET_HANDLED, does it matter ?!?
Todo:
Error catching...

DBusConnection * DBus_Server::openSystemConnection  )  [static]
 

Opens a new connection to the system bus, tries to register the service and returns a filedescriptor to watch for.

Returns:
filedescriptor to watch on or negative value on failure

bool DBus_Server::sendMethodCall const char *  interface,
const char *  path,
const char *  object,
const char *  method
[static]
 

send a method call over the bus

Parameters:
interface the interface to sent to
path the object path to sent to
object the object to sent to
method the method to sent
Returns:
true if successfull, false otherwise

void DBus_Server::sendReply DBusMessage *  reply,
int  error_id
[static, private]
 

static bool DBus_Server::serviceHasOwner const std::string &  service  )  [static]
 

check if a service is registered on the bus

Parameters:
service the service to check for
Returns:
true if successfull, false otherwise


Member Data Documentation

DBusConnection * DBus_Server::_connection = NULL [static]
 


The documentation for this class was generated from the following files:
Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6