7 #ifndef PXR_BASE_TF_SCOPE_DESCRIPTION_H 8 #define PXR_BASE_TF_SCOPE_DESCRIPTION_H 14 #include "pxr/base/tf/api.h" 20 PXR_NAMESPACE_OPEN_SCOPE
60 TfCallContext
const &context = TfCallContext());
67 TfCallContext
const &context = TfCallContext());
74 TfCallContext
const &context = TfCallContext());
99 friend inline char const *
101 return d->_description;
103 friend inline TfCallContext
const &
109 inline void _Pop()
const;
111 std::optional<std::string> _ownedString;
112 char const *_description;
113 TfCallContext _context;
122 TF_API std::vector<std::string>
128 TF_API std::vector<std::string>
136 #define TF_DESCRIBE_SCOPE(...) \ 137 TfScopeDescription __scope_description__ \ 138 (Tf_DescribeScopeFormat(__VA_ARGS__), TF_CALL_CONTEXT); \ 140 template <
typename... Args>
142 Tf_DescribeScopeFormat(
const char* fmt, Args&&... args) {
150 Tf_DescribeScopeFormat(
const char* fmt) {
return fmt; }
153 Tf_DescribeScopeFormat(std::string&& fmt) {
return std::move(fmt); }
155 inline const std::string&
156 Tf_DescribeScopeFormat(
const std::string& fmt) {
return fmt; }
158 PXR_NAMESPACE_CLOSE_SCOPE
160 #endif // PXR_BASE_TF_SCOPE_DESCRIPTION_H TF_API std::string TfStringPrintf(const char *fmt,...)
Returns a string formed by a printf()-like specification.
Functions for recording call locations.
TF_API ~TfScopeDescription()
Destructor.
Definitions of basic string utilities in tf.
TF_API std::vector< std::string > TfGetCurrentScopeDescriptionStack()
Return a copy of the current description stack for the "main" thread as identified by ArchGetMainThre...
TF_API void SetDescription(std::string const &description)
Replace the description stack entry for this scope description.
TF_API std::vector< std::string > TfGetThisThreadScopeDescriptionStack()
Return a copy of the current description stack for the current thread of execution as a vector of str...
This class is used to provide high-level descriptions about scopes of execution that could possibly b...