stage.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_ESF_STAGE_H
8 #define PXR_EXEC_ESF_STAGE_H
9 
11 
12 #include "pxr/pxr.h"
13 
15 
16 #include "pxr/base/tf/token.h"
17 #include "pxr/base/tf/type.h"
18 
19 #include <utility>
20 
21 PXR_NAMESPACE_OPEN_SCOPE
22 
23 class EsfAttribute;
24 class EsfJournal;
25 class EsfObject;
26 class EsfPrim;
27 class EsfProperty;
28 class EsfRelationship;
29 class SdfPath;
30 
42 {
43 public:
44  ESF_API ~EsfStageInterface() override;
45 
47  ESF_API EsfAttribute GetAttributeAtPath(
48  const SdfPath &path,
49  EsfJournal *journal) const;
50 
52  ESF_API EsfObject GetObjectAtPath(
53  const SdfPath &path,
54  EsfJournal *journal) const;
55 
57  ESF_API EsfPrim GetPrimAtPath(
58  const SdfPath &path,
59  EsfJournal *journal) const;
60 
62  ESF_API EsfProperty GetPropertyAtPath(
63  const SdfPath &path,
64  EsfJournal *journal) const;
65 
67  ESF_API EsfRelationship GetRelationshipAtPath(
68  const SdfPath &path,
69  EsfJournal *journal) const;
70 
72  std::pair<TfToken, TfToken> GetTypeNameAndInstance(
73  const TfToken &apiSchemaName) const {
74  return _GetTypeNameAndInstance(apiSchemaName);
75  }
76 
79  const TfToken &schemaTypeName) const {
80  return _GetAPITypeFromSchemaTypeName(schemaTypeName);
81  }
82 
83 private:
84  // These methods must be implemented by the scene adapter implementation.
85  virtual EsfAttribute _GetAttributeAtPath(
86  const SdfPath &path) const = 0;
87  virtual EsfObject _GetObjectAtPath(
88  const SdfPath &path) const = 0;
89  virtual EsfPrim _GetPrimAtPath(
90  const SdfPath &path) const = 0;
91  virtual EsfProperty _GetPropertyAtPath(
92  const SdfPath &path) const = 0;
93  virtual EsfRelationship _GetRelationshipAtPath(
94  const SdfPath &path) const = 0;
95  virtual std::pair<TfToken, TfToken> _GetTypeNameAndInstance(
96  const TfToken &apiSchemaName) const = 0;
97  virtual TfType _GetAPITypeFromSchemaTypeName(
98  const TfToken &schemaTypeName) const = 0;
99 };
100 
107 class EsfStage : public EsfFixedSizePolymorphicHolder<EsfStageInterface, 16>
108 {
109 public:
111 };
112 
113 PXR_NAMESPACE_CLOSE_SCOPE
114 
115 #endif
Holds an implementation of EsfStageInterface in a fixed-size buffer.
Definition: stage.h:107
Stores a collection of edit reasons associated with scene objects.
Definition: journal.h:37
Holds an implementation of EsfPrimInterface in a fixed-size buffer.
Definition: prim.h:84
Stage abstraction for scene adapter implementations.
Definition: stage.h:41
Stores polymorphic objects in a fixed-size buffer.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
std::pair< TfToken, TfToken > GetTypeNameAndInstance(const TfToken &apiSchemaName) const
Definition: stage.h:72
Holds an implementation of EsfObjectInterface in a fixed-size buffer.
Definition: object.h:159
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
Holds an implementation of EsfAttributeInterface in a fixed-size buffer.
Definition: attribute.h:68
Enables a base class to be used with EsfFixedSizePolymorphicHolder.
Holds an implementation of EsfRelationshipInterface in a fixed-size buffer.
Definition: relationship.h:59
Holds an implementation of EsfPropertyInterface in a fixed-size buffer.
Definition: property.h:60
TfType represents a dynamic runtime type.
Definition: type.h:47
TfType GetAPITypeFromSchemaTypeName(const TfToken &schemaTypeName) const
Definition: stage.h:78
EsfFixedSizePolymorphicHolder()=delete
The default constructor is deleted because instances must always contain a derived object.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...