Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
docbrown.h
Go to the documentation of this file.
1 // This file is part of MARTY.
2 //
3 // MARTY is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // MARTY is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with MARTY. If not, see <https://www.gnu.org/licenses/>.
15 
23 #pragma once
24 
25 #include "checkpoint.h"
26 #include "fileData.h"
27 #include "csldatahandler.h"
28 
29 namespace mty::doc {
30 
31 class DocBrown {
32 
33  friend class DocBuilder;
34 
35 public:
36 
37  DocBrown(
38  std::string_view path,
39  std::string_view headerName,
40  std::string_view sourceName,
41  std::string_view jsonCSLDataName,
42  std::string_view jsonCheckPointNames
43  );
44 
45  void addCheckPoint(std::shared_ptr<CheckPoint_Base> const &cp);
46 
47  void writeData();
48 
49  static
50  std::string join(
51  std::string_view path,
52  std::string_view file
53  );
54 
55 private:
56 
57  void ensurePath();
58  void writeCheckPointsData();
59  void writeCSLData();
60  void writeComparator();
61 
62 private:
63 
64  CSLDataHandler cslHandler;
65  FileData fileData;
66  std::vector<std::shared_ptr<CheckPoint_Base>> checkPoints;
67  std::string path;
68  std::string headerName;
69  std::string sourceName;
70  std::string jsonCSLData;
71  std::string jsonCheckPoints;
72 };
73 
74 #ifdef DOC_BROWN_DEBUG_MODE
75  inline std::unique_ptr<DocBrown> emmett
76  = std::make_unique<DocBrown>(
77  "emmett",
78  "emmett_debugger" MARTY_VERSION_STR ".h",
79  "emmett_debugger" MARTY_VERSION_STR ".cpp",
80  "emmett_debugger" MARTY_VERSION_STR ".json",
81  "emmett_checkpoints" MARTY_VERSION_STR ".json"
82  );
83 #endif
84 
85 }
Definition: fileData.h:34
Contains checkpoints for doc brown&#39;s debugger procedure.
Definition: checkpoint.h:38
Definition: docbrown.h:31
Definition: csldatahandler.h:35
File data utility for doc brown&#39;s debugger.
Contains the handler of CSL data for doc brown&#39;s debugger.