Loading...
Searching...
No Matches
parserPlugin.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
8#ifndef PXR_USD_SDR_PARSER_PLUGIN_H
9#define PXR_USD_SDR_PARSER_PLUGIN_H
10
17
18#include "pxr/pxr.h"
19#include "pxr/base/tf/type.h"
21#include "pxr/base/tf/weakPtr.h"
22#include "pxr/usd/sdr/api.h"
23#include "pxr/usd/sdr/declare.h"
26
27PXR_NAMESPACE_OPEN_SCOPE
28
29// Forward declarations
31
33#define SDR_REGISTER_PARSER_PLUGIN(ParserPluginClass) \
34TF_REGISTRY_FUNCTION(TfType) \
35{ \
36 TfType::Define<ParserPluginClass, TfType::Bases<SdrParserPlugin>>() \
37 .SetFactory<SdrParserPluginFactory<ParserPluginClass>>(); \
38}
39
116{
117public:
118 SDR_API
120 SDR_API
121 virtual ~SdrParserPlugin();
122
129 SDR_API
130 NdrNodeUniquePtr Parse(
131 const NdrNodeDiscoveryResult& discoveryResult) override;
132
136 SDR_API
137 virtual SdrShaderNodeUniquePtr ParseShaderNode(
138 const SdrShaderNodeDiscoveryResult& discoveryResult) = 0;
139
143 SDR_API
144 static SdrShaderNodeUniquePtr GetInvalidShaderNode(
146};
147
150using SdrParserPluginFactoryBase = NdrParserPluginFactoryBase;
151
152template<class T>
153using SdrParserPluginFactory = NdrParserPluginFactory<T>;
154
156
157PXR_NAMESPACE_CLOSE_SCOPE
158
159#endif // PXR_USD_SDR_PARSER_PLUGIN_H
Interface for parser plugins.
Definition: parserPlugin.h:119
Interface for parser plugins.
Definition: parserPlugin.h:116
virtual SDR_API SdrShaderNodeUniquePtr ParseShaderNode(const SdrShaderNodeDiscoveryResult &discoveryResult)=0
Takes the specified SdrShaderNodeDiscoveryResult instance, which was a result of the discovery proces...
static SDR_API SdrShaderNodeUniquePtr GetInvalidShaderNode(const SdrShaderNodeDiscoveryResult &dr)
Gets an invalid node based on the discovery result provided.
SDR_API NdrNodeUniquePtr Parse(const NdrNodeDiscoveryResult &discoveryResult) override
Takes the specified NdrNodeDiscoveryResult instance, which was a result of the discovery process,...
Represents the raw data of a node, and some other bits of metadata, that were determined via a NdrDis...
Represents the raw data of a node, and some other bits of metadata, that were determined via a SdrDis...
Pointer storage with deletion detection.