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 }
gtsam::debugFlags
GTSAM_EXPORT FastMap< std::string, ValueWithDefault< bool, false > > debugFlags
Definition: debug.cpp:28
s
RealScalar s
Definition: level1_cplx_impl.h:126
gtsam::FastMap
Definition: FastMap.h:39
gtsam::guardedIsDebug
bool guardedIsDebug(const std::string &s)
Definition: debug.cpp:35
gtsam::guardedSetDebug
void guardedSetDebug(const std::string &s, const bool v)
Definition: debug.cpp:43
gtsam
traits
Definition: SFMdata.h:40
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
gtsam::isDebugVersion
bool isDebugVersion()
Definition: debug.cpp:50
debug.h
Global debugging flags.


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:10