casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DBusBase.h
Go to the documentation of this file.
1 #ifndef CASA_DBUS_BASE_H__
2 #define CASA_DBUS_BASE_H__
3 
4 #include <thread>
5 #if defined(DBUS_CPP)
6 #include <dbus-cpp/dbus.h>
7 #else
8 #include <dbus-c++/dbus.h>
9 #endif
10 
11 namespace casacore{
12 
13  class Record;
14 }
15 
16 namespace casa {
17 
18 
20 {
21  public:
24 
25  void stopService();
26 
27  /* Methods to make translating to/from the map easy */
28  static std::map<std::string,DBus::Variant> fromRecord(casacore::Record);
29  static casacore::Record toRecord(std::map<std::string,DBus::Variant>);
30 
31  private:
32 
33  void serviceLoop();
34  std::thread *itsThread;
35 };
36 
37  class DBusService : public DBus::IntrospectableAdaptor,
38  public DBus::ObjectAdaptor,
39  public DBusThreadedBase
40 {
41  public:
42  DBusService(const std::string &bus_name, const std::string &object_path);
43  ~DBusService();
44 };
45 
46  class ServiceProxy : public DBus::IntrospectableProxy,
47  public DBus::ObjectProxy,
48  public DBusThreadedBase
49 {
50  public:
51  ServiceProxy(const std::string& serviceName);
52  ~ServiceProxy();
53 };
54 
55 }
56 
57 #endif
DBusService(const std::string &bus_name, const std::string &object_path)
ServiceProxy(const std::string &serviceName)
A hierarchical collection of named fields of various types.
Definition: Record.h:180
std::thread * itsThread
Definition: DBusBase.h:34
static std::map< std::string, DBus::Variant > fromRecord(casacore::Record)
static casacore::Record toRecord(std::map< std::string, DBus::Variant >)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42