swift
Public Member Functions | Protected Member Functions | List of all members
XSwiftBus::CDBusObject Class Referenceabstract

DBus base object. More...

Inheritance diagram for XSwiftBus::CDBusObject:
[legend]

Public Member Functions

 CDBusObject (CSettingsProvider *settingsProvider)
 Constructor.
 
virtual ~CDBusObject ()
 Destructor.
 
void setDBusConnection (const std::shared_ptr< CDBusConnection > &dbusConnection)
 Set the assigned DBus connection. More...
 
void registerDBusObjectPath (const std::string &interfaceName, const std::string &objectPath)
 Register itself with interfaceName and objectPath. More...
 

Protected Member Functions

virtual void dbusConnectedHandler ()
 Handler which is called when DBusCconnection is established.
 
virtual DBusHandlerResult dbusMessageHandler (const CDBusMessage &message)=0
 DBus message handler.
 
virtual void dbusDisconnectedHandler ()
 Handler which is called when DBusConnection disconnected.
 
void sendDBusSignal (const std::string &name)
 Send DBus signal.
 
void sendDBusMessage (const CDBusMessage &message)
 Send DBus message.
 
void maybeSendEmptyDBusReply (bool wantsReply, const std::string &destination, dbus_uint32_t serial)
 Maybe sends an empty DBus reply (acknowledgement)
 
template<typename T >
void sendDBusReply (const std::string &destination, dbus_uint32_t serial, const T &argument)
 Send DBus reply.
 
template<typename T >
void sendDBusReply (const std::string &destination, dbus_uint32_t serial, const std::vector< T > &array)
 Send DBus reply.
 
void queueDBusCall (const std::function< void()> &func)
 Queue a DBus call to be executed in a different thread.
 
void invokeQueuedDBusCalls ()
 Invoke all pending DBus calls. They will be executed in the calling thread.
 
- Protected Member Functions inherited from XSwiftBus::CSettingsAware
 CSettingsAware (CSettingsProvider *provider)
 Constructor.
 
 ~CSettingsAware ()=default
 Destructor.
 
CSettings getSettings () const
 Get settings. More...
 
void setSettings (const CSettings &settings)
 Set settings. More...
 
const CConfiggetConfig () const
 Get settings from xswiftbus.conf (needed during plugin initialization) More...
 
bool writeConfig (bool tcas, bool debug)
 Write a config file with these new values. More...
 

Detailed Description

DBus base object.

Definition at line 19 of file dbusobject.h.

Member Function Documentation

◆ registerDBusObjectPath()

void XSwiftBus::CDBusObject::registerDBusObjectPath ( const std::string &  interfaceName,
const std::string &  objectPath 
)

Register itself with interfaceName and objectPath.

Warning
Before calling this method, make sure that a valid DBus connection was set.

Definition at line 26 of file dbusobject.cpp.

◆ setDBusConnection()

void XSwiftBus::CDBusObject::setDBusConnection ( const std::shared_ptr< CDBusConnection > &  dbusConnection)

Set the assigned DBus connection.

Remarks
Currently one object can only manage one connection at a time

Definition at line 17 of file dbusobject.cpp.


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