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 Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_BASE_TF_DIAGNOSTIC_HELPER_H
25 #define PXR_BASE_TF_DIAGNOSTIC_HELPER_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/base/tf/api.h"
30 #include "pxr/base/arch/defines.h"
31 
32 // XXX: This include is a hack to avoid build errors due to
33 // incompatible macro definitions in pyport.h on macOS.
34 #include <locale>
35 
36 #include <any>
37 #include <string>
38 
39 // Follow up changes should more tightly scope these to just where it's needed
40 // in pxr.
41 #if defined(ARCH_OS_LINUX) || defined(ARCH_OS_DARWIN)
42 // Include <unistd.h> to provide _exit for tf/debugger.cpp and dependencies
43 // that were previously transitively getting this from hboost
44 #include <unistd.h>
45 // Include <cstring> to provide memset, memcmp, and memcpy for dependencies
46 // that were previously transitively getting them from hboost
47 #include <cstring>
48 #endif
49 
51 
53 class TfCallContext;
54 enum TfDiagnosticType : int;
55 class TfEnum;
56 class TfError;
57 
58 TF_API void
60  const TfCallContext &context,
61  const TfEnum &code,
62  const std::string &msg);
63 
64 TF_API void
66  const TfCallContext &context,
67  TfDiagnosticType code,
68  const std::string &msg);
69 
70 TF_API void
72  const TfCallContext &context,
73  const TfEnum &code,
74  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
75 
76 TF_API void
78  const TfCallContext &context,
79  TfDiagnosticType code,
80  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
81 
82 TF_API void
84  const TfCallContext &context,
85  const TfDiagnosticInfo &info,
86  const TfEnum &code,
87  const std::string &msg);
88 
89 TF_API void
91  const TfCallContext &context,
92  const TfDiagnosticInfo &info,
93  const TfEnum &code,
94  const char *fmt, ...) ARCH_PRINTF_FUNCTION(4, 5);
95 
96 TF_API void
98  const TfCallContext &context,
99  const TfEnum &code,
100  const TfDiagnosticInfo &info,
101  const std::string &msg);
102 
103 TF_API void
105  const TfCallContext &context,
106  const TfEnum &code,
107  const TfDiagnosticInfo &info,
108  const char *fmt, ...) ARCH_PRINTF_FUNCTION(4, 5);
109 
110 TF_API void
112  const TfCallContext &context,
113  const TfEnum &code,
114  const std::string &msg);
115 
116 TF_API void
118  const TfCallContext &context,
119  const TfEnum &code,
120  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
121 
122 
123 // Helper functions for posting a warning with TF_WARN.
124 TF_API void
125 Tf_PostWarningHelper(const TfCallContext &context,
126  const std::string &msg);
127 
128 TF_API void
129 Tf_PostWarningHelper(const TfCallContext &context,
130  const char *fmt, ...) ARCH_PRINTF_FUNCTION(2, 3);
131 
132 TF_API void
134  const TfCallContext &context,
135  const TfEnum &code,
136  const std::string &msg);
137 
138 TF_API void
140  const TfCallContext &context,
141  TfDiagnosticType code,
142  const std::string &msg);
143 
144 TF_API void
146  const TfCallContext &context,
147  const TfEnum &code,
148  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
149 
150 TF_API void
152  const TfCallContext &context,
153  TfDiagnosticType code,
154  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
155 
156 TF_API void
158  const TfCallContext &context,
159  const TfDiagnosticInfo &info,
160  const TfEnum &code,
161  const std::string &msg);
162 
163 TF_API void
165  const TfCallContext &context,
166  const TfDiagnosticInfo &info,
167  const TfEnum &code,
168  const char *fmt, ...) ARCH_PRINTF_FUNCTION(4, 5);
169 
170 TF_API void
172  const TfCallContext &context,
173  const char *fmt, ...) ARCH_PRINTF_FUNCTION(2, 3);
174 
175 TF_API void
177  const TfCallContext &context,
178  const std::string &msg);
179 
180 
181 TF_API void
183  const TfCallContext &context,
184  const TfEnum &code,
185  const std::string &msg);
186 
187 TF_API void
189  const TfCallContext &context,
190  const TfEnum &code,
191  const char *fmt, ...) ARCH_PRINTF_FUNCTION(3, 4);
192 
193 TF_API void
195  const TfCallContext &context,
196  const TfDiagnosticInfo &info,
197  const TfEnum &code,
198  const std::string &msg);
199 
200 TF_API void
202  const TfCallContext &context,
203  const TfDiagnosticInfo &info,
204  const TfEnum &code,
205  const char *fmt, ...) ARCH_PRINTF_FUNCTION(4, 5);
206 
208 
209 #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:40
PXR_NAMESPACE_OPEN_SCOPE typedef std::any TfDiagnosticInfo
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
Definition: enum.h:136
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:3468
TfDiagnosticType
Definition: error.h:49
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:1432
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91