Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
doc_brown_link.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 #ifdef DOC_BROWN_DEBUG_MODE
26 
27  #include "docbrown.h"
28 
29  #define CHECK_POINT_BUILD(Name, Type)\
30  static std::shared_ptr<mty::doc::CheckPoint_Base> Name \
31  = std::make_shared<mty::doc::CheckPoint<Type>>(#Name);\
32  mty::doc::emmett->addCheckPoint(Name);\
33  using type_check_point_data_Name = Type;
34 
35  #define CHECK_POINT_BUILD_ARGS(Name, Type, ...)\
36  std::shared_ptr<mty::doc::CheckPoint_Base> Name \
37  = std::make_shared<mty::doc::CheckPoint<Type>>(#Name, __VA_ARGS__);\
38  mty::doc::emmett->addCheckPoint(Name);
39 
40  #define CHECK_POINT_ADD_TO(Name, data)\
41  std::dynamic_pointer_cast<mty::doc::CheckPoint<\
42  type_check_point_data_Name\
43  >>(Name)->push_back(data);
44 
45  #define CHECK_POINT_CALL(Name, func)\
46  std::dynamic_pointer_cast<mty::doc::CheckPoint<\
47  type_check_point_data_Name\
48  >>(Name)->func();
49  #define CHECK_POINT_CALL_ARGS(Name, func, ...)\
50  std::dynamic_pointer_cast<mty::doc::CheckPoint<\
51  type_check_point_data_Name\
52  >>(Name)->func(__VA_ARGS__);
53 
54 #else
55 
56  #define CHECK_POINT_BUILD(...)
57  #define CHECK_POINT_BUILD_ARGS(...)
58  #define CHECK_POINT_ADD_TO(...)
59  #define CHECK_POINT_CALL(...)
60  #define CHECK_POINT_CALL_ARGS(...)
61 
62 #endif
Main utilities for doc brown&#39;s debugger.