utility.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <dbus/dbus.h>
00021 #include <dbus-cxx/pointer.h>
00022
00023 #ifndef DBUSCXX_UTILITY_H
00024 #define DBUSCXX_UTILITY_H
00025
00026 #define DBUS_CXX_PARAM_LIMIT 7
00027
00028 #ifdef DBUS_CXX_DEBUG_ENABLED
00029 #include <iostream>
00030
00031 #define DEBUG_OUT(x,y) if (DEBUG) std::cout << x << " " << pthread_self() << ": " << y << std::endl
00032 #define DBUS_CXX_DEBUG(x) std::cout << pthread_self() << ": " << x << std::endl
00033
00034
00035 #else
00036 #define DEBUG_OUT(x,y) ;
00037 #define DBUS_CXX_DEBUG(x) ;
00038 #endif
00039
00040 #define DBUS_CXX_INTROSPECTABLE_INTERFACE "org.freedesktop.DBus.Introspectable"
00041
00061 #define DBUS_CXX_ITERATOR_SUPPORT( CppType, DBusType ) \
00062 inline \
00063 DBus::MessageIterator& operator>>(DBus::MessageIterator& __msgiter, CppType& __cpptype) \
00064 { \
00065 DBusType __dbustype; \
00066 __msgiter >> __dbustype; \
00067 __cpptype = static_cast< CppType >( __dbustype ); \
00068 return __msgiter; \
00069 } \
00070 \
00071 inline \
00072 DBus::MessageAppendIterator& operator<<(DBus::MessageAppendIterator& __msgiter, CppType& __cpptype) \
00073 { \
00074 __msgiter << static_cast< DBusType >( __cpptype ); \
00075 return __msgiter; \
00076 } \
00077 \
00078 namespace DBus { \
00079 template<> inline std::string signature< CppType >() { return signature< DBusType >(); } \
00080 }
00081
00082
00083 namespace DBus
00084 {
00085
00091 void init(bool threadsafe=true);
00092
00098 bool initialized();
00099
00100 }
00101
00102 #endif