HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diagnosticHelper.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_BASE_TF_DIAGNOSTIC_HELPER_H
8 #define PXR_BASE_TF_DIAGNOSTIC_HELPER_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/base/tf/api.h"
13 #include "pxr/base/arch/defines.h"
14 
15 // XXX: This include is a hack to avoid build errors due to
16 // incompatible macro definitions in pyport.h on macOS.
17 #include <locale>
18 
19 #include <any>
20 #include <string>
21 
22 // Follow up changes should more tightly scope these to just where it's needed
23 // in pxr.
24 #if defined(ARCH_OS_LINUX) || defined(ARCH_OS_DARWIN)
25 // Include <unistd.h> to provide _exit for tf/debugger.cpp and dependencies
26 // that were previously transitively getting this from boost
27 #include <unistd.h>
28 // Include <cstring> to provide memset, memcmp, and memcpy for dependencies
29 // that were previously transitively getting them from boost
30 #include <cstring>
31 #endif
32 
34 
36 class TfCallContext;
37 enum TfDiagnosticType : int;
38 class TfEnum;
39 class TfError;
40 
41 TF_API void
43  const TfCallContext &context,
44  const TfEnum &code,
45  const std::string &msg);
46 
47 TF_API void
49  const TfCallContext &context,
50  TfDiagnosticType code,
51  const std::string &msg);
52 
53 TF_API void
55  const TfCallContext &context,
56  const TfEnum &code,
57  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
58 
59 TF_API void
61  const TfCallContext &context,
62  TfDiagnosticType code,
63  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
64 
65 TF_API void
67  const TfCallContext &context,
68  const TfDiagnosticInfo &info,
69  const TfEnum &code,
70  const std::string &msg);
71 
72 TF_API void
74  const TfCallContext &context,
75  const TfDiagnosticInfo &info,
76  const TfEnum &code,
77  const char *fmt, ...) ARCH_PRINTF_FUNCTION(4, 5);
78 
79 TF_API void
81  const TfCallContext &context,
82  const TfEnum &code,
83  const TfDiagnosticInfo &info,
84  const std::string &msg);
85 
86 TF_API void
88  const TfCallContext &context,
89  const TfEnum &code,
90  const TfDiagnosticInfo &info,
91  const char *fmt, ...) ARCH_PRINTF_FUNCTION(4, 5);
92 
93 TF_API void
95  const TfCallContext &context,
96  const TfEnum &code,
97  const std::string &msg);
98 
99 TF_API void
101  const TfCallContext &context,
102  const TfEnum &code,
103  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
104 
105 
106 // Helper functions for posting a warning with TF_WARN.
107 TF_API void
108 Tf_PostWarningHelper(const TfCallContext &context,
109  const std::string &msg);
110 
111 TF_API void
112 Tf_PostWarningHelper(const TfCallContext &context,
113  const char *fmt, ...) ARCH_PRINTF_FUNCTION(2, 3);
114 
115 TF_API void
117  const TfCallContext &context,
118  const TfEnum &code,
119  const std::string &msg);
120 
121 TF_API void
123  const TfCallContext &context,
124  TfDiagnosticType code,
125  const std::string &msg);
126 
127 TF_API void
129  const TfCallContext &context,
130  const TfEnum &code,
131  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
132 
133 TF_API void
135  const TfCallContext &context,
136  TfDiagnosticType code,
137  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
138 
139 TF_API void
141  const TfCallContext &context,
142  const TfDiagnosticInfo &info,
143  const TfEnum &code,
144  const std::string &msg);
145 
146 TF_API void
148  const TfCallContext &context,
149  const TfDiagnosticInfo &info,
150  const TfEnum &code,
151  const char *fmt, ...) ARCH_PRINTF_FUNCTION(4, 5);
152 
153 TF_API void
155  const TfCallContext &context,
156  const char *fmt, ...) ARCH_PRINTF_FUNCTION(2, 3);
157 
158 TF_API void
160  const TfCallContext &context,
161  const std::string &msg);
162 
163 
164 TF_API void
166  const TfCallContext &context,
167  const TfEnum &code,
168  const std::string &msg);
169 
170 TF_API void
172  const TfCallContext &context,
173  const TfEnum &code,
174  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
175 
176 TF_API void
178  const TfCallContext &context,
179  const TfDiagnosticInfo &info,
180  const TfEnum &code,
181  const std::string &msg);
182 
183 TF_API void
185  const TfCallContext &context,
186  const TfDiagnosticInfo &info,
187  const TfEnum &code,
188  const char *fmt, ...) ARCH_PRINTF_FUNCTION(4, 5);
189 
191 
192 #endif // PXR_BASE_TF_DIAGNOSTIC_HELPER_H
TF_API void TF_API void Tf_PostStatusHelper(const TfCallContext &context, const char *fmt,...) ARCH_PRINTF_FUNCTION(2
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
#define TF_API
Definition: api.h:23
PXR_NAMESPACE_OPEN_SCOPE typedef std::any TfDiagnosticInfo
Definition: enum.h:119
TF_API void TF_API void Tf_PostQuietlyErrorHelper(const TfCallContext &context, const TfEnum &code, const TfDiagnosticInfo &info, const std::string &msg)
TF_API void TF_API void Tf_PostWarningHelper(const TfCallContext &context, const std::string &msg)
bool any(const vbool4 &v)
Definition: simd.h:3600
TfDiagnosticType
Definition: error.h:32
TF_API void Tf_PostErrorHelper(const TfCallContext &context, const TfEnum &code, const std::string &msg)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74