dbus-cxx logo
Namespaces | Macros | Functions
utility.h File Reference
#include <dbus/dbus.h>
#include <dbus-cxx/pointer.h>
#include <dbus-cxx/simplelogger_defs.h>
Include dependency graph for utility.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 DBus
 

Macros

#define DBUS_CXX_INTROSPECTABLE_INTERFACE   "org.freedesktop.DBus.Introspectable"
 
#define DBUS_CXX_ITERATOR_SUPPORT(CppType, DBusType)
 Provides support for unsupported types that can be cast to DBus supported types. More...
 

Functions

void DBus::init (bool threadsafe=true)
 Initializes the dbus-cxx library. More...
 
bool DBus::initialized ()
 Get the initialization state of the dbus-cxx library. More...
 
void DBus::setLoggingFunction (::simplelogger_log_function function)
 Set the callback function that is used for printing log messages. More...
 
void DBus::logStdErr (const char *logger_name, const struct::SL_LogLocation *location, const enum::SL_LogLevel level, const char *log_string)
 Log messages to stderr(std::cerr). More...
 
void DBus::setLogLevel (const enum::SL_LogLevel level)
 When used in conjunction with DBus::logStdErr, will only print out log messages above the set level. More...
 

Macro Definition Documentation

#define DBUS_CXX_INTROSPECTABLE_INTERFACE   "org.freedesktop.DBus.Introspectable"
#define DBUS_CXX_ITERATOR_SUPPORT (   CppType,
  DBusType 
)
Value:
inline \
DBus::MessageIterator& operator>>(DBus::MessageIterator& __msgiter, CppType& __cpptype) \
{ \
DBusType __dbustype; \
__msgiter >> __dbustype; \
__cpptype = static_cast< CppType >( __dbustype ); \
return __msgiter; \
} \
\
inline \
DBus::MessageAppendIterator& operator<<(DBus::MessageAppendIterator& __msgiter, CppType& __cpptype) \
{ \
__msgiter << static_cast< DBusType >( __cpptype ); \
return __msgiter; \
} \
\
namespace DBus { \
inline std::string signature( CppType ) { DBusType d; return signature( d ); } \
}
Definition: accumulators.h:24
DBus::Connection::pointer operator<<(DBus::Connection::pointer ptr, DBus::Message::pointer msg)
Definition: connection.h:712
DBus::Message::iterator operator>>(DBus::Message::const_pointer ptr, T &value)
Definition: message.h:170
Insertion iterator allow values to be appended to a message.
Definition: messageappenditerator.h:43
std::string signature(uint8_t &)
Definition: signature.h:94
Extraction iterator allowing values to be retrieved from a message.
Definition: messageiterator.h:37

Provides support for unsupported types that can be cast to DBus supported types.

This macro provides message iterator and introspection support for types that are not supported by the DBus native types, but can be static_cast<> to a DBus native type. Typically, this is an enum.

Parameters
CppTypeThe unsupported type. Must be able to static_cast<> to DBusType
DBusTypeOne of the types inherently supported by dbus-cxx

Example supporting an enum as a 32-bit int:

1 typedef MyEnum { ZERO, ONE, TWO, THREE } MyEnum;
2 
3 DBUS_CXX_ITERATOR_SUPPORT( MyEnum, uint32_t )

Generated on Sun Mar 19 2017 14:54:27 for dbus-cxx by doxygen 1.8.8