dbus-cxx logo
utility.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2007,2008,2009,2010 by Rick L. Vinyard, Jr. *
3  * rvinyard@cs.nmsu.edu *
4  * *
5  * This file is part of the dbus-cxx library. *
6  * *
7  * The dbus-cxx library is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU General Public License *
9  * version 3 as published by the Free Software Foundation. *
10  * *
11  * The dbus-cxx library is distributed in the hope that it will be *
12  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this software. If not see <http://www.gnu.org/licenses/>. *
18  ***************************************************************************/
19 
20 #include <dbus/dbus.h>
21 #include <dbus-cxx/pointer.h>
23 
24 #ifndef DBUSCXX_UTILITY_H
25 #define DBUSCXX_UTILITY_H
26 
27 #define DBUS_CXX_INTROSPECTABLE_INTERFACE "org.freedesktop.DBus.Introspectable"
28 
48 #define DBUS_CXX_ITERATOR_SUPPORT( CppType, DBusType ) \
49  inline \
50  DBus::MessageIterator& operator>>(DBus::MessageIterator& __msgiter, CppType& __cpptype) \
51  { \
52  DBusType __dbustype; \
53  __msgiter >> __dbustype; \
54  __cpptype = static_cast< CppType >( __dbustype ); \
55  return __msgiter; \
56  } \
57  \
58  inline \
59  DBus::MessageAppendIterator& operator<<(DBus::MessageAppendIterator& __msgiter, CppType& __cpptype) \
60  { \
61  __msgiter << static_cast< DBusType >( __cpptype ); \
62  return __msgiter; \
63  } \
64  \
65  namespace DBus { \
66  inline std::string signature( CppType ) { DBusType d; return signature( d ); } \
67  }
68 
69 
70 namespace DBus
71 {
72 
78  void init(bool threadsafe=true);
79 
85  bool initialized();
86 
92 
98  void logStdErr( const char* logger_name, const struct ::SL_LogLocation* location,
99  const enum ::SL_LogLevel level,
100  const char* log_string );
101 
106  void setLogLevel( const enum ::SL_LogLevel level );
107 
108 }
109 
110 #endif
Definition: accumulators.h:24
SL_LogLevel
Level of the log message.
Definition: simplelogger_defs.h:26
void init(bool threadsafe)
Initializes the dbus-cxx library.
Definition: utility.cpp:40
void setLogLevel(const enum SL_LogLevel level)
Definition: utility.cpp:91
void setLoggingFunction(simplelogger_log_function function)
Definition: utility.cpp:70
bool initialized()
Get the initialization state of the dbus-cxx library.
Definition: utility.cpp:65
void logStdErr(const char *logger_name, const struct SL_LogLocation *location, const enum SL_LogLevel level, const char *log_string)
Definition: utility.cpp:74
void(* simplelogger_log_function)(const char *logger_name, const struct SL_LogLocation *location, const enum SL_LogLevel level, const char *log_string)
Pointer to a function that does the actual log operation.
Definition: simplelogger_defs.h:38

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