MythTV  master
logMessage.h
Go to the documentation of this file.
1 // Program Name: logMessage.h
3 //
4 // Licensed under the GPL v2 or later, see COPYING for details
5 //
7 
8 #ifndef LOGMESSAGE_H_
9 #define LOGMESSAGE_H_
10 
11 #include <QString>
12 #include <QDateTime>
13 
14 #include "serviceexp.h"
15 #include "datacontracthelper.h"
16 
17 namespace DTC
18 {
19 
20 class SERVICE_PUBLIC LogMessage : public QObject
21 {
22  Q_OBJECT
23  Q_CLASSINFO( "version" , "1.0" );
24 
25  Q_PROPERTY( QString HostName READ HostName
26  WRITE setHostName )
27  Q_PROPERTY( QString Application READ Application
28  WRITE setApplication )
29  Q_PROPERTY( int PID READ PID
30  WRITE setPID )
31  Q_PROPERTY( int TID READ TID
32  WRITE setTID )
33  Q_PROPERTY( QString Thread READ Thread
34  WRITE setThread )
35  Q_PROPERTY( QString Filename READ Filename
36  WRITE setFilename )
37  Q_PROPERTY( int Line READ Line
38  WRITE setLine )
39  Q_PROPERTY( QString Function READ Function
40  WRITE setFunction )
41  Q_PROPERTY( QDateTime Time READ Time
42  WRITE setTime )
43  Q_PROPERTY( QString Level READ Level
44  WRITE setLevel )
45  Q_PROPERTY( QString Message READ Message
46  WRITE setMessage )
47 
48  PROPERTYIMP( QString , HostName )
49  PROPERTYIMP( QString , Application )
50  PROPERTYIMP( int , PID )
51  PROPERTYIMP( int , TID )
52  PROPERTYIMP( QString , Thread )
53  PROPERTYIMP( QString , Filename )
54  PROPERTYIMP( int , Line )
55  PROPERTYIMP( QString , Function )
56  PROPERTYIMP( QDateTime, Time )
57  PROPERTYIMP( QString , Level )
58  PROPERTYIMP( QString , Message );
59 
60  public:
61 
62  static inline void InitializeCustomTypes();
63 
64  Q_INVOKABLE LogMessage(QObject *parent = nullptr)
65  : QObject ( parent ),
66  m_HostName ( ),
67  m_Application ( ),
68  m_PID ( 0 ),
69  m_TID ( 0 ),
70  m_Thread ( ),
71  m_Filename ( ),
72  m_Line ( 0 ),
73  m_Function ( ),
74  m_Level ( ),
75  m_Message ( )
76  {
77  }
78 
79  void Copy( const LogMessage *src )
80  {
81  m_HostName = src->m_HostName ;
82  m_Application = src->m_Application ;
83  m_PID = src->m_PID ;
84  m_TID = src->m_TID ;
85  m_Thread = src->m_Thread ;
86  m_Filename = src->m_Filename ;
87  m_Line = src->m_Line ;
88  m_Function = src->m_Function ;
89  m_Time = src->m_Time ;
90  m_Level = src->m_Level ;
91  m_Message = src->m_Message ;
92  }
93 
94  private:
96 };
97 
99 {
100  qRegisterMetaType< LogMessage* >();
101 }
102 
103 } // namespace DTC
104 
105 #endif
DTC::LogMessage::Copy
void Copy(const LogMessage *src)
Definition: logMessage.h:79
DTC::LogMessage::Q_DISABLE_COPY
Q_DISABLE_COPY(LogMessage)
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
DTC::LogMessage
Definition: logMessage.h:21
datacontracthelper.h
serviceexp.h
DTC::LogMessage::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: logMessage.h:98
PROPERTYIMP
#define PROPERTYIMP(type, name)
Definition: datacontracthelper.h:56
DTC
Definition: datacontracthelper.h:110