Skip to content

Commit

Permalink
service: refactor the low-level service-side bindings
Browse files Browse the repository at this point in the history
Main points of this implementation:

On the base class level:

* DBusObject is the main class exported on the bus. Unlike before, it now derives
  from Tp::Object, so it can be put in a SharedPtr etc...  DBusService then
  inherits DBusObject and provides the additional service registration functionality.
* AbstractDBusInterfaceAdaptee is the base class of all adaptees. This is a class
  that provides the mechanism that allows 'plugging' adaptees on the main DBusObject.
  There is no base class for the Adaptor anymore.

On the generated level:

* The Adaptor looks like before, api-wise, but is not exported
* It relies purely on C++, there is no QMetaObject magic
* The Adaptee creates the Adaptor internally when the object is about to be
  registered. The Adaptee is still fully usable when it is not registered
* Adaptee properties act as cache variables for the values exported on the bus.
  They are always read/write, even if they are read-only on the bus, so that
  the implementation can set the values internally.
* Writable properties have an additional signal on the Adaptee that notifies
  the implementation when a property was set from the bus. The property is
  set anyway, even if the implementation doesn't handle the new value
* DBus API methods on the Adaptee can be implemented with a callback.
  They always return void and the return values are returned from the
  context (async API, yay!)
* DBus API signals are implemented as emitFoo() slots on the Adaptee,
  which feels more natural than having Q_SIGNALS that are meant to be
  emitted instead of connected to.

#5
  • Loading branch information
gkiagia committed Nov 11, 2016
1 parent dc4afff commit ad66242
Show file tree
Hide file tree
Showing 13 changed files with 731 additions and 762 deletions.
13 changes: 0 additions & 13 deletions TelepathyQt/AbstractAdaptor

This file was deleted.

13 changes: 13 additions & 0 deletions TelepathyQt/AbstractDBusInterfaceAdaptee
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _TelepathyQt_AbstractDBusInterfaceAdaptee_HEADER_GUARD_
#define _TelepathyQt_AbstractDBusInterfaceAdaptee_HEADER_GUARD_

#ifndef IN_TP_QT_HEADER
#define IN_TP_QT_HEADER
#endif

#include <TelepathyQt/dbus-object.h>

#undef IN_TP_QT_HEADER

#endif
// vim:set ft=cpp:
13 changes: 0 additions & 13 deletions TelepathyQt/AbstractDBusServiceInterface

This file was deleted.

14 changes: 6 additions & 8 deletions TelepathyQt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -858,14 +858,11 @@ if(ENABLE_SERVICE_SUPPORT)
dbus-error.cpp
dbus-object.cpp
dbus-service.cpp
io-device.cpp
abstract-adaptor.cpp)
io-device.cpp)

set(telepathy_qt_service_HEADERS
AbstractAdaptor
abstract-adaptor.h
AbstractDBusServiceInterface
AbstractProtocolInterface
AbstractDBusInterfaceAdaptee
#AbstractProtocolInterface
#BaseCall
#base-call.h
#BaseConnectionManager
Expand Down Expand Up @@ -901,7 +898,6 @@ if(ENABLE_SERVICE_SUPPORT)

# Headers file moc will be run on
set(telepathy_qt_service_MOC_SRCS
abstract-adaptor.h
#base-call.h
#base-call-internal.h
#base-connection-manager.h
Expand Down Expand Up @@ -932,8 +928,10 @@ if(ENABLE_SERVICE_SUPPORT)
DEPENDS stable-typesgen)
set(NEW_FILES
${CMAKE_CURRENT_BINARY_DIR}/_gen/${spec}.h
${CMAKE_CURRENT_BINARY_DIR}/_gen/${spec}_p.h
${CMAKE_CURRENT_BINARY_DIR}/_gen/${spec}.cpp
${CMAKE_CURRENT_BINARY_DIR}/_gen/${spec}.moc.hpp)
${CMAKE_CURRENT_BINARY_DIR}/_gen/${spec}.moc.hpp
${CMAKE_CURRENT_BINARY_DIR}/_gen/${spec}_p.moc.hpp)
list(APPEND telepathy_qt_service_SRCS ${NEW_FILES})
list(APPEND telepathy_qt_service_generated_specs_mocs "moc-${spec}.moc.hpp")
set_source_files_properties(${NEW_FILES} PROPERTIES GENERATED true)
Expand Down
107 changes: 0 additions & 107 deletions TelepathyQt/abstract-adaptor.cpp

This file was deleted.

60 changes: 0 additions & 60 deletions TelepathyQt/abstract-adaptor.h

This file was deleted.

Loading

0 comments on commit ad66242

Please sign in to comment.