debug.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 #include <gtsam/base/debug.h>
20 #include <gtsam/config.h> // for GTSAM_USE_TBB
21 
22 #ifdef GTSAM_USE_TBB
23 #include <mutex> // std::mutex, std::unique_lock
24 #endif
25 
26 namespace gtsam {
27 
29 
30 #ifdef GTSAM_USE_TBB
31 std::mutex debugFlagsMutex;
32 #endif
33 
34 /* ************************************************************************* */
35 bool guardedIsDebug(const std::string& s) {
36 #ifdef GTSAM_USE_TBB
37  std::unique_lock<std::mutex> lock(debugFlagsMutex);
38 #endif
39  return gtsam::debugFlags[s];
40 }
41 
42 /* ************************************************************************* */
43 void guardedSetDebug(const std::string& s, const bool v) {
44 #ifdef GTSAM_USE_TBB
45  std::unique_lock<std::mutex> lock(debugFlagsMutex);
46 #endif
48 }
49 
51 #ifdef NDEBUG
52  // nondebug
53  return false;
54 #else
55  // debug
56  return true;
57 #endif
58 
59 }
60 
61 }
void guardedSetDebug(const std::string &s, const bool v)
Definition: debug.cpp:43
Global debugging flags.
Array< int, Dynamic, 1 > v
RealScalar s
traits
Definition: chartTesting.h:28
bool isDebugVersion()
Definition: debug.cpp:50
bool guardedIsDebug(const std::string &s)
Definition: debug.cpp:35
GTSAM_EXPORT FastMap< std::string, ValueWithDefault< bool, false > > debugFlags
Definition: debug.cpp:28


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:09