24 #ifndef PXR_BASE_TF_DIAGNOSTIC_BASE_H 25 #define PXR_BASE_TF_DIAGNOSTIC_BASE_H 40 #include <boost/any.hpp> 44 PXR_NAMESPACE_OPEN_SCOPE
46 typedef boost::any TfDiagnosticInfo;
74 return _context.GetFile();
80 return _context.GetLine();
91 _context.GetPrettyFunction());
105 if (_commentary.empty())
160 template <
typename T>
162 return boost::any_cast<T>(&_info);
193 TfCallContext
const &context,
194 const std::string& commentary,
195 TfDiagnosticInfo info,
bool quiet);
198 TfCallContext _context;
200 std::string _commentary;
202 std::string _codeString;
203 TfDiagnosticInfo _info;
212 PXR_NAMESPACE_CLOSE_SCOPE
214 #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.
Define function attributes.
Definitions of basic string utilities in tf.
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.
bool IsCodingError() const
Return true if this diagnostic's code is either a fatal or nonfatal coding error.
bool IsFatal() const
Return true if this diagnostic's code is a fatal code.
TfDiagnosticBase(TfEnum code, char const *codeString, TfCallContext const &context, const std::string &commentary, TfDiagnosticInfo info, bool quiet)
Construct an instance.
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.
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.
std::string GetPrettyPrintString() const
Return the commentary string.
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.