HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
registerSchema.h
Go to the documentation of this file.
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_EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA_H
8 #define PXR_EXEC_EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA_H
9 
10 /// \file
11 
12 #include "pxr/pxr.h"
13 
15 #include "pxr/exec/exec/types.h"
16 
18 #include "pxr/base/tf/type.h"
19 
21 
22 // Generates a schema computation registration function name.
23 //
24 /// \cond
25 #define _EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA_NAME(SchemaType) Exec_RegisterSchema_##SchemaType
26 /// \endcond
27 
28 /// \ingroup group_Exec_ComputationDefinitionLanguage
29 /// \hideinitializer
30 ///
31 /// Initiates registration of exec computations for the schema \p SchemaType.
32 ///
33 /// \param SchemaType
34 /// The schema type for which exec computations can be registered in the code
35 /// block that follows an invocation of this macro.
36 ///
37 /// > **Note:**
38 /// > For the full reference on the domain-specific language that is used to
39 /// > register exec computations refer to the [Computation Definition
40 /// > Language](#group_Exec_ComputationDefinitionLanguage) reference page.
41 ///
42 #define EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA(SchemaType) \
43  \
44  PXR_NAMESPACE_OPEN_SCOPE \
45  \
46  /* Putting the registration fuction in the same namespace as the input */ \
47  /* classes/functions makes it so we can use unadorned names for the */ \
48  /* arguments to .Inputs(), etc. */ \
49  namespace exec_registration { \
50  /* Forward declaration of the static registration function. */ \
51  static void _EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA_NAME(SchemaType) ( \
52  PXR_NS::ExecComputationBuilder &self); \
53  } \
54  \
55  /* The registry function calls the schema computation registration */ \
56  /* function. */ \
57  TF_REGISTRY_FUNCTION(ExecDefinitionRegistryTag) { \
58  ExecComputationBuilder self = \
59  ExecComputationBuilder::ConstructionAccess::Construct( \
60  TfType::FindByName(#SchemaType)); \
61  PXR_NS::exec_registration::_EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA_NAME( \
62  SchemaType)(self); \
63  } \
64  \
65  PXR_NAMESPACE_CLOSE_SCOPE \
66  \
67  /* Define the schema computation registration function. The body of the */ \
68  /* function is provided by the client code that calls this macro. */ \
69  static void \
70  PXR_NS::exec_registration::_EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA_NAME( \
71  SchemaType)(PXR_NS::ExecComputationBuilder &self)
72 
74 
75 #endif
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74