24 #ifndef PXR_BASE_TF_SCOPE_DESCRIPTION_H
25 #define PXR_BASE_TF_SCOPE_DESCRIPTION_H
32 #include "pxr/base/tf/api.h"
34 #include <boost/optional.hpp>
35 #include <boost/preprocessor/if.hpp>
40 PXR_NAMESPACE_OPEN_SCOPE
63 TfCallContext
const &context = TfCallContext());
69 TfScopeDescription(std::string &&description,
70 TfCallContext
const &context = TfCallContext());
76 TfScopeDescription(
char const *description,
77 TfCallContext
const &context = TfCallContext());
98 friend inline TfScopeDescription *
99 Tf_GetPreviousScopeDescription(TfScopeDescription *d) {
102 friend inline char const *
103 Tf_GetScopeDescriptionText(TfScopeDescription *d) {
104 return d->_description;
106 friend inline TfCallContext
const &
107 Tf_GetScopeDescriptionContext(TfScopeDescription *d) {
112 inline void _Pop()
const;
114 boost::optional<std::string> _ownedString;
115 char const *_description;
116 TfCallContext _context;
118 TfScopeDescription *_prev;
125 TF_API std::vector<std::string>
126 TfGetCurrentScopeDescriptionStack();
131 TF_API std::vector<std::string>
132 TfGetThisThreadScopeDescriptionStack();
136 #define TF_DESCRIBE_SCOPE(fmt, ...) \
137 TfScopeDescription __scope_description__ \
138 (BOOST_PP_IF(TF_NUM_ARGS(__VA_ARGS__), \
139 TfStringPrintf(fmt, __VA_ARGS__), fmt), TF_CALL_CONTEXT)
141 PXR_NAMESPACE_CLOSE_SCOPE
143 #endif // PXR_BASE_TF_SCOPE_DESCRIPTION_H
Functions for recording call locations.
TF_API ~TfScopeDescription()
Destructor.
Definitions of basic string utilities in tf.
TF_API void SetDescription(std::string const &description)
Replace the description stack entry for this scope description.
This class is used to provide high-level descriptions about scopes of execution that could possibly b...