24 #ifndef PXR_BASE_TF_DIAGNOSTIC_BASE_H 25 #define PXR_BASE_TF_DIAGNOSTIC_BASE_H 30 #include "pxr/base/tf/api.h" 41 #include <boost/any.hpp> 45 PXR_NAMESPACE_OPEN_SCOPE
47 typedef boost::any TfDiagnosticInfo;
75 return _context.GetFile();
81 return _context.GetLine();
92 _context.GetPrettyFunction());
106 if (_commentary.empty())
161 template <
typename T>
163 return boost::any_cast<T>(&_info);
194 TfCallContext
const &context,
195 const std::string& commentary,
196 TfDiagnosticInfo info,
bool quiet);
199 TfCallContext _context;
201 std::string _commentary;
203 std::string _codeString;
204 TfDiagnosticInfo _info;
213 PXR_NAMESPACE_CLOSE_SCOPE
215 #endif // PXR_BASE_TF_DIAGNOSTIC_BASE_H Define preprocessor function name macros.
Singleton class through which all errors and diagnostics pass.
std::string GetSourceFunction() const
Return the source function that the diagnostic message was posted from.
Functions for recording call locations.
void SetInfo(TfDiagnosticInfo any)
Set the info object associated with this diagnostic message.
TF_API TfDiagnosticBase(TfEnum code, char const *codeString, TfCallContext const &context, const std::string &commentary, TfDiagnosticInfo info, bool quiet)
Construct an instance.
Define function attributes.
Definitions of basic string utilities in tf.
TF_API bool IsCodingError() const
Return true if this diagnostic's code is either a fatal or nonfatal coding error.
An enum class that records both enum type and enum value.
const std::string & GetDiagnosticCodeAsString() const
Return the diagnostic code posted as a string.
Pointer storage with deletion detection.
size_t GetSourceLineNumber() const
Return the source line number that the diagnostic message was posted from.
const TfCallContext & GetContext() const
Return the call context where the message was issued.
Represents the base class of an object representing a diagnostic message.
void AugmentCommentary(const std::string &s)
Add to the commentary string describing this diagnostic message.
Class used to record the end of the error-list.
std::string const & GetCommentary() const
Return the commentary string describing this diagnostic message.
TF_API bool IsFatal() const
Return true if this diagnostic's code is a fatal code.
const T * GetInfo() const
Return a (possibly NULL) const pointer to the info object associated with this message.
std::string GetSourceFileName() const
Return the source file name that the diagnostic message was posted from.
TfEnum GetDiagnosticCode() const
Return the diagnostic code posted.
bool GetQuiet() const
Return true if the message was posted via PostQuietly().
ARCH_API std::string ArchGetPrettierFunctionName(const std::string &function, const std::string &prettyFunction)
Return well formatted function name.
A facility for transporting errors from thread to thread.