OROCHI
 
Loading...
Searching...
No Matches
GxReportLog.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13#if GX_DEVELOP
14
15GX_CORE_NAMESPACE_BEGIN()
16
17struct GxString;
19
20//===========================================================================
22//===========================================================================
23class GxReportLog : public SingletonBase<GxReportLog>
24{
25 //-------------------------------------------------------------
27 //-------------------------------------------------------------
29public:
31 static constexpr u32 LOG_SIZE = GxMath::VALUE_16M;
33 static constexpr u32 LOG_COUNT_MAX = GxMath::VALUE_1M;
34private:
36 struct GxLog
37 {
38 s32 _category;
39 GX_CSTR _pStart;
40 GX_CSTR _pEnd;
41 };
42
44 //-------------------------------------------------------------
46 //-------------------------------------------------------------
48public:
50 b32 initialize( void );
51
53 void cleanup( void );
54
55private:
57 GxReportLog(void);
58
60 ~GxReportLog(void) {}
61
63 GxReportLog(const GxReportLog& log);
64
66 const GxReportLog& operator = (const GxReportLog& log);
67
69 //-------------------------------------------------------------
71 //-------------------------------------------------------------
73public:
75 void addLog(u32 category, GX_CSTR log);
77 void clearLog( void );
78
79private:
81 GX_CSTR addLogSub( GX_CSTR log );
82
84 void addLogUpdate( GX_CSTR log, const s32 logSize );
85
87 //-------------------------------------------------------------
89 //-------------------------------------------------------------
91public:
93 u32 getLogSize(void) const;
95 void getLog(GxString& out);
97 void getLog(GxString& out, u32 category, const GxString* pFilterText = nullptr) const;
99 constexpr u32 getLogIndex(void) const { return _logIndex; }
100
102 //-------------------------------------------------------------
104 //-------------------------------------------------------------
106private:
107 GX_STR _pBuffer;
108 GX_STR _pWrite;
109 b32 _isLogLooped;
110
111 GxCriticalSection _criticalSection;
112 static GxReportLog _instance;
113
114 GxLog _logs[LOG_COUNT_MAX];
115 u32 _logIndex;
116
118};
119
120// アクセスインターフェイス
121GX_FORCE_INLINE GxReportLog* getGxReportLog( void ) { return GxReportLog::getSingletonPointer(); }
122
123GX_CORE_NAMESPACE_END()
124
125#endif // GX_DEVELOP
クリティカルセクションクラス
Definition GxThread.h:20
static constexpr u32 VALUE_1M
1M
Definition GxMath.h:139
static constexpr u32 VALUE_16M
16M
Definition GxMath.h:143
シングルトン基礎クラス
Definition GxSingleton.h:19
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173