MythTV  master
backendInfo.h
Go to the documentation of this file.
1 // Program Name: backendInfo.h
3 // Created : Dec. 15, 2015
4 //
5 // Copyright (c) 2015 Bill Meek, from: 2010 David Blain <dblain@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef BACKENDINFO_H_
12 #define BACKENDINFO_H_
13 
14 #include "serviceexp.h"
15 #include "datacontracthelper.h"
16 
17 #include "buildInfo.h"
18 #include "envInfo.h"
19 #include "logInfo.h"
20 
21 namespace DTC
22 {
23 
24 class SERVICE_PUBLIC BackendInfo : public QObject
25 {
26  Q_OBJECT
27 
28  Q_CLASSINFO( "version" , "1.0" );
29 
30  Q_PROPERTY( QObject* Build READ Build )
31  Q_PROPERTY( QObject* Env READ Env )
32  Q_PROPERTY( QObject* Log READ Log )
33 
34  PROPERTYIMP_PTR( BuildInfo, Build )
35  PROPERTYIMP_PTR( EnvInfo, Env )
36  PROPERTYIMP_PTR( LogInfo, Log );
37 
38  public:
39 
40  static inline void InitializeCustomTypes();
41 
42  Q_INVOKABLE BackendInfo(QObject *parent = nullptr)
43  : QObject ( parent ),
44  m_Build ( nullptr ),
45  m_Env ( nullptr ),
46  m_Log ( nullptr )
47  {
48  }
49 
50  void Copy( const BackendInfo *src )
51  {
52  // We always need to make sure the child object is
53  // created with the correct parent *
54 
55  if (src->m_Build)
56  Build()->Copy( src->m_Build );
57 
58  if (src->m_Env)
59  Env()->Copy( src->m_Env );
60 
61  if (src->m_Log)
62  Log()->Copy( src->m_Log );
63 
64  }
65 
66  private:
67  Q_DISABLE_COPY(BackendInfo);
68 };
69 
71 
73 {
74  qRegisterMetaType< BackendInfo* >();
75 
79 }
80 
81 } // namespace DTC
82 
83 #endif
static void InitializeCustomTypes()
Definition: logInfo.h:54
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
static void InitializeCustomTypes()
Definition: backendInfo.h:72
BackendInfo * BackendInfoPtr
Definition: backendInfo.h:70
static void InitializeCustomTypes()
Definition: buildInfo.h:61
#define PROPERTYIMP_PTR(type, name)
static void InitializeCustomTypes()
Definition: envInfo.h:69
void Copy(const BackendInfo *src)
Definition: backendInfo.h:50