Qt 4.8
Classes | Functions
qdbusmetatype.h File Reference
#include "QtCore/qmetatype.h"
#include <QtDBus/qdbusargument.h>

Go to the source code of this file.

Classes

class  QDBusMetaType
 Meta-type registration system for the QtDBus module. More...
 

Functions

template<typename T >
void qDBusDemarshallHelper (const QDBusArgument &arg, T *t)
 
template<typename T >
void qDBusMarshallHelper (QDBusArgument &arg, const T *t)
 
template<typename T >
int qDBusRegisterMetaType ()
 

Function Documentation

◆ qDBusDemarshallHelper()

template<typename T >
void qDBusDemarshallHelper ( const QDBusArgument arg,
T *  t 
)

Definition at line 75 of file qdbusmetatype.h.

76 { arg >> *t; }

◆ qDBusMarshallHelper()

template<typename T >
void qDBusMarshallHelper ( QDBusArgument arg,
const T *  t 
)

Definition at line 71 of file qdbusmetatype.h.

72 { arg << *t; }

◆ qDBusRegisterMetaType()

template<typename T >
int qDBusRegisterMetaType ( )
related

Definition at line 79 of file qdbusmetatype.h.

84 {
85  void (*mf)(QDBusArgument &, const T *) = qDBusMarshallHelper<T>;
86  void (*df)(const QDBusArgument &, T *) = qDBusDemarshallHelper<T>;
87 
88  int id = qRegisterMetaType<T>(); // make sure it's registered
90  reinterpret_cast<QDBusMetaType::MarshallFunction>(mf),
91  reinterpret_cast<QDBusMetaType::DemarshallFunction>(df));
92  return id;
93 }
The QDBusArgument class is used to marshall and demarshall D-Bus arguments.
Definition: qdbusargument.h:69
static void registerMarshallOperators(int typeId, MarshallFunction, DemarshallFunction)
Registers the marshalling and demarshalling functions for meta type id.