Loading...
Searching...
No Matches
error.h
1//
2// Copyright 2025 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_EXEC_VDF_ERROR_H
8#define PXR_EXEC_VDF_ERROR_H
9
10#include "pxr/pxr.h"
11
12#include "pxr/exec/vdf/api.h"
14
15PXR_NAMESPACE_OPEN_SCOPE
16
17class VdfNode;
18
19struct Vdf_ErrorHelper : public Tf_DiagnosticHelper {
20 Vdf_ErrorHelper(TfCallContext const &context,
21 TfDiagnosticType type = TF_DIAGNOSTIC_INVALID_TYPE) :
22 Tf_DiagnosticHelper(context, type) {}
23 VDF_API
24 void FatalError(const VdfNode &node, std::string const &msg) const;
25 VDF_API
26 void FatalError(const VdfNode &node, char const *fmt, ...) const
28};
29
35#define VDF_FATAL_ERROR \
36 Vdf_ErrorHelper(TF_CALL_CONTEXT).FatalError
37
43#define VDF_AXIOM(node, cond) \
44 do { \
45 if (ARCH_UNLIKELY(!(cond))) \
46 Vdf_ErrorHelper(TF_CALL_CONTEXT). \
47 FatalError(node, "Failed axiom: ' %s '", #cond); \
48 } while (0)
49
50PXR_NAMESPACE_CLOSE_SCOPE
51
52#endif
#define ARCH_PRINTF_FUNCTION(_fmt, _firstArg)
Macro used to indicate a function takes a printf-like specification.
Definition: attributes.h:34
Low-level utilities for informing users of various internal and external diagnostic conditions.
This is the base class for all nodes in a VdfNetwork.
Definition: node.h:53
TfDiagnosticType
Enum describing various diagnostic conditions.