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 LICENSE for details
8 //
10 
11 #ifndef BACKENDINFO_H_
12 #define BACKENDINFO_H_
13 
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
DTC::BackendInfo::Copy
void Copy(const BackendInfo *src)
Definition: backendInfo.h:50
DTC::BuildInfo
Definition: buildInfo.h:22
logInfo.h
DTC::LogInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: logInfo.h:54
DTC::LogInfo
Definition: logInfo.h:22
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
DTC::EnvInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: envInfo.h:69
DTC::BackendInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: backendInfo.h:72
datacontracthelper.h
buildInfo.h
serviceexp.h
DTC::BuildInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: buildInfo.h:61
DTC::EnvInfo
Definition: envInfo.h:22
PROPERTYIMP_PTR
#define PROPERTYIMP_PTR(type, name)
Definition: datacontracthelper.h:102
DTC::BackendInfo
Definition: backendInfo.h:24
DTC
Definition: datacontracthelper.h:123
envInfo.h