ARCS6 AR6-REV.24062600
読み取り中…
検索中…
一致する文字列を見つけられません
ARCSeventlog.hh
[詳解]
1
9//
10// Copyright (C) 2011-2024 Yokokura, Yuki
11// MIT License. For details, see the LICENSE file.
12
13#ifndef ARCSEVENTLOG
14#define ARCSEVENTLOG
15
16#include <sched.h>
17#include <string>
18#include <ctime>
19
20// 前方宣言
21namespace ARCS{
22 class ARCSscreen;
23}
24
25// 関数呼び出し用マクロ
26#define PassedLog() (ARCSeventlog::PassedLog_from_macro(__FILE__,__LINE__,sched_getcpu(),std::clock()))
27#define EventLog(a) (ARCSeventlog::EventLog_from_macro(a,__FILE__,__LINE__,sched_getcpu(),std::clock()))
28#define EventLogVar(a) (ARCSeventlog::EventLogVar_from_macro(a,#a,__FILE__,__LINE__,sched_getcpu(),std::clock()))
29
30namespace ARCS {
33 public:
34 ARCSeventlog();
36 void SetScreenPtr(ARCSscreen* ScrPtr);
37
38 // 下記の関数はマクロから呼ばれることを想定
39 static void EventLog_from_macro(
40 const std::string& str,
41 const std::string& file, const int line, const int cpu, const clock_t time);
42 static void EventLogVar_from_macro(
43 const double u, const std::string& varname,
44 const std::string& file, const int line, const int cpu, const clock_t time);
45 static void PassedLog_from_macro(
46 const std::string& file, const int line, const int cpu, const clock_t time);
47
48 static void WriteEventLog(const std::string& str, const std::string& file, const int line);
49 static void WriteEventLog(
50 const std::string& str,
51 const std::string& file, const int line, const int cpu, const clock_t time);
52
53 private:
54 ARCSeventlog(const ARCSeventlog&) = delete;
55 const ARCSeventlog& operator=(const ARCSeventlog&) = delete;
56
57 static ARCSscreen* ARCSscreenPtr;
58};
59}
60
61#endif
62
ARCS イベントログクラス
Definition ARCSeventlog.hh:32
static void PassedLog_from_macro(const std::string &file, const int line, const int cpu, const clock_t time)
イベントログを残す関数(ファイルと行番号のみ記録版)
Definition ARCSeventlog.cc:85
~ARCSeventlog()
デストラクタ
Definition ARCSeventlog.cc:39
static void WriteEventLog(const std::string &str, const std::string &file, const int line)
イベントログをファイルに書き出す
Definition ARCSeventlog.cc:96
ARCSeventlog()
コンストラクタ
Definition ARCSeventlog.cc:26
static void EventLog_from_macro(const std::string &str, const std::string &file, const int line, const int cpu, const clock_t time)
イベントログを残す関数 (任意メッセージ記録版)
Definition ARCSeventlog.cc:55
void SetScreenPtr(ARCSscreen *ScrPtr)
ARCS画面ポインタの設定
Definition ARCSeventlog.cc:45
static void EventLogVar_from_macro(const double u, const std::string &varname, const std::string &file, const int line, const int cpu, const clock_t time)
変数用イベントログ u : 表示する変数, varname : 変数名
Definition ARCSeventlog.cc:72
ARCS画面描画クラス
Definition ARCSscreen.hh:32