prim.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_PRIM_H
8 #define PXR_EXEC_ESF_PRIM_H
9 
11 
12 #include "pxr/pxr.h"
13 
14 #include "pxr/exec/esf/api.h"
16 #include "pxr/exec/esf/object.h"
17 
18 #include "pxr/base/tf/token.h"
19 #include "pxr/base/tf/type.h"
20 #include "pxr/usd/sdf/path.h"
21 
22 PXR_NAMESPACE_OPEN_SCOPE
23 
24 class EsfJournal;
25 class EsfPrim;
26 class EsfAttribute;
27 
36 class ESF_API_TYPE EsfPrimInterface : public EsfObjectInterface
37 {
38 public:
39  ESF_API ~EsfPrimInterface() override;
40 
42  ESF_API const TfTokenVector &GetAppliedSchemas(EsfJournal *journal) const;
43 
45  ESF_API EsfAttribute GetAttribute(
46  const TfToken &attributeName,
47  EsfJournal *journal) const;
48 
50  ESF_API EsfRelationship GetRelationship(
51  const TfToken &relationshipName,
52  EsfJournal *journal) const;
53 
55  ESF_API EsfPrim GetParent(EsfJournal *journal) const;
56 
58  ESF_API TfType GetType(EsfJournal *journal) const;
59 
61  virtual bool IsPseudoRoot() const = 0;
62 
63 protected:
66 
67 private:
68  // These methods must be implemented by the scene adapter implementation.
69  virtual const TfTokenVector &_GetAppliedSchemas() const = 0;
70  virtual EsfAttribute _GetAttribute(
71  const TfToken &attributeName) const = 0;
72  virtual EsfPrim _GetParent() const = 0;
73  virtual EsfRelationship _GetRelationship(
74  const TfToken &relationshipName) const = 0;
75  virtual TfType _GetType() const = 0;
76 };
77 
84 class EsfPrim : public EsfFixedSizePolymorphicHolder<EsfPrimInterface, 48>
85 {
86 public:
88 };
89 
90 PXR_NAMESPACE_CLOSE_SCOPE
91 
92 #endif
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
Scene object abstraction for scene adapter implementations.
Definition: object.h:44
Stores polymorphic objects in a fixed-size buffer.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:489
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
EsfPrimInterface(const SdfPath &path)
This constructor may only be called by the scene adapter implementation.
Definition: prim.h:65
Prim abstraction for scene adapter implementations.
Definition: prim.h:36
Holds an implementation of EsfRelationshipInterface in a fixed-size buffer.
Definition: relationship.h:59
TfType represents a dynamic runtime type.
Definition: type.h:47
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...