All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PcpLayerStack Class Reference

Represents a stack of layers that contribute opinions to composition. More...

+ Inheritance diagram for PcpLayerStack:

Public Member Functions

PCP_API const
PcpLayerStackIdentifier
GetIdentifier () const
 Returns the identifier for this layer stack. More...
 
PCP_API const
SdfLayerRefPtrVector & 
GetLayers () const
 Returns the layers in this layer stack in strong-to-weak order. More...
 
PCP_API SdfLayerHandleVector GetSessionLayers () const
 Returns only the session layers in the layer stack in strong-to-weak order. More...
 
PCP_API const SdfLayerTreeHandleGetLayerTree () const
 Returns the layer tree representing the structure of this layer stack. More...
 
PCP_API const SdfLayerOffsetGetLayerOffsetForLayer (const SdfLayerHandle &) const
 Returns the layer offset for the given layer, or NULL if the layer can't be found or is the identity. More...
 
PCP_API const SdfLayerOffsetGetLayerOffsetForLayer (const SdfLayerRefPtr &) const
 Return the layer offset for the given layer, or NULL if the layer can't be found or is the identity. More...
 
PCP_API const SdfLayerOffsetGetLayerOffsetForLayer (size_t layerIdx) const
 Returns the layer offset for the layer at the given index in this layer stack. More...
 
PCP_API const std::set
< std::string > & 
GetMutedLayers () const
 Returns the set of layers that were muted in this layer stack. More...
 
PcpErrorVector GetLocalErrors () const
 Return the list of errors local to this layer stack. More...
 
PCP_API bool HasLayer (const SdfLayerHandle &layer) const
 Returns true if this layer stack contains the given layer, false otherwise. More...
 
PCP_API bool HasLayer (const SdfLayerRefPtr &layer) const
 
double GetTimeCodesPerSecond () const
 Return the time codes per second value of the layer stack. More...
 
PCP_API const SdfRelocatesMapGetRelocatesSourceToTarget () const
 Returns relocation source-to-target mapping for this layer stack. More...
 
PCP_API const SdfRelocatesMapGetRelocatesTargetToSource () const
 Returns relocation target-to-source mapping for this layer stack. More...
 
PCP_API const SdfRelocatesMapGetIncrementalRelocatesSourceToTarget () const
 Returns incremental relocation source-to-target mapping for this layer stack. More...
 
PCP_API const SdfRelocatesMapGetIncrementalRelocatesTargetToSource () const
 Returns incremental relocation target-to-source mapping for this layer stack. More...
 
PCP_API const SdfPathVector & GetPathsToPrimsWithRelocates () const
 Returns a list of paths to all prims across all layers in this layer stack that contained relocates. More...
 
PCP_API void Apply (const PcpLayerStackChanges &changes, PcpLifeboat *lifeboat)
 Apply the changes in changes. More...
 
PCP_API PcpMapExpression GetExpressionForRelocatesAtPath (const SdfPath &path)
 Return a PcpMapExpression representing the relocations that affect namespace at and below the given path. More...
 
- Public Member Functions inherited from TfRefBase
size_t GetCurrentCount () const
 Return the current reference count of this object. More...
 
bool IsUnique () const
 Return true if only one TfRefPtr points to this object. More...
 
const TfRefCountGetRefCount () const
 
void SetShouldInvokeUniqueChangedListener (bool shouldCall)
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void const * GetUniqueIdentifier () const
 

Friends

class PcpCache
 

Additional Inherited Members

- Public Types inherited from TfRefBase
typedef void(* UniqueChangedFuncPtr )(TfRefBase const *, bool)
 
- Static Public Member Functions inherited from TfRefBase
static TF_API void SetUniqueChangedListener (UniqueChangedListener listener)
 
- Protected Member Functions inherited from TfWeakBase
TfRefPtr< Tf_Remnant > _Register () const
 
template<class T >
TfRefPtr< Tf_Remnant > _Register (T *tempRmnt) const
 
bool _HasRemnant () const
 

Detailed Description

Represents a stack of layers that contribute opinions to composition.

Each PcpLayerStack is identified by a PcpLayerStackIdentifier. This identifier contains all of the parameters needed to construct a layer stack, such as the root layer, session layer, and path resolver context.

PcpLayerStacks are constructed and managed by a Pcp_LayerStackRegistry.

Definition at line 65 of file layerStack.h.

Member Function Documentation

PCP_API void Apply ( const PcpLayerStackChanges changes,
PcpLifeboat lifeboat 
)

Apply the changes in changes.

This blows caches. It's up to the client to pull on those caches again as needed.

Objects that are no longer needed and would be destroyed are retained in lifeboat and won't be destroyed until lifeboat is itself destroyed. This gives the client control over the timing of the destruction of those objects. Clients may choose to pull on the caches before destroying lifeboat. That may cause the caches to again retain the objects, meaning they won't be destroyed when lifeboat is destroyed.

For example, if blowing a cache means an SdfLayer is no longer needed then lifeboat will hold an SdfLayerRefPtr to that layer. The client can then pull on that cache, which could cause the cache to hold an SdfLayerRefPtr to the layer again. If so then destroying changes will not destroy the layer. In any case, we don't destroy the layer and then read it again. However, if the client destroys lifeboat before pulling on the cache then we would destroy the layer then read it again.

PCP_API PcpMapExpression GetExpressionForRelocatesAtPath ( const SdfPath path)

Return a PcpMapExpression representing the relocations that affect namespace at and below the given path.

The value of this expression will continue to track the effective relocations if they are changed later.

PCP_API const PcpLayerStackIdentifier& GetIdentifier ( ) const

Returns the identifier for this layer stack.

PCP_API const SdfRelocatesMap& GetIncrementalRelocatesSourceToTarget ( ) const

Returns incremental relocation source-to-target mapping for this layer stack.

This map contains the individual relocation entries found across all layers in this layer stack; it does not combine ancestral entries with descendant entries. For instance, if this layer stack contains relocations { /A: /B } and { /A/C: /A/D }, this map will contain { /A: /B } and { /A/C: /A/D }.

PCP_API const SdfRelocatesMap& GetIncrementalRelocatesTargetToSource ( ) const

Returns incremental relocation target-to-source mapping for this layer stack.

See GetIncrementalRelocatesTargetToSource for more details.

PCP_API const SdfLayerOffset* GetLayerOffsetForLayer ( const SdfLayerHandle &  ) const

Returns the layer offset for the given layer, or NULL if the layer can't be found or is the identity.

PCP_API const SdfLayerOffset* GetLayerOffsetForLayer ( const SdfLayerRefPtr ) const

Return the layer offset for the given layer, or NULL if the layer can't be found or is the identity.

PCP_API const SdfLayerOffset* GetLayerOffsetForLayer ( size_t  layerIdx) const

Returns the layer offset for the layer at the given index in this layer stack.

Returns NULL if the offset is the identity.

PCP_API const SdfLayerRefPtrVector& GetLayers ( ) const

Returns the layers in this layer stack in strong-to-weak order.

Note that this is only the local layer stack – it does not include any layers brought in by references inside prims.

PCP_API const SdfLayerTreeHandle& GetLayerTree ( ) const

Returns the layer tree representing the structure of this layer stack.

PcpErrorVector GetLocalErrors ( ) const
inline

Return the list of errors local to this layer stack.

Definition at line 115 of file layerStack.h.

PCP_API const std::set<std::string>& GetMutedLayers ( ) const

Returns the set of layers that were muted in this layer stack.

PCP_API const SdfPathVector& GetPathsToPrimsWithRelocates ( ) const

Returns a list of paths to all prims across all layers in this layer stack that contained relocates.

PCP_API const SdfRelocatesMap& GetRelocatesSourceToTarget ( ) const

Returns relocation source-to-target mapping for this layer stack.

This map combines the individual relocation entries found across all layers in this layer stack; multiple entries that affect a single prim will be combined into a single entry. For instance, if this layer stack contains relocations { /A: /B } and { /A/C: /A/D }, this map will contain { /A: /B } and { /B/C: /B/D }. This allows consumers to go from unrelocated namespace to relocated namespace in a single step.

PCP_API const SdfRelocatesMap& GetRelocatesTargetToSource ( ) const

Returns relocation target-to-source mapping for this layer stack.

See GetRelocatesSourceToTarget for more details.

PCP_API SdfLayerHandleVector GetSessionLayers ( ) const

Returns only the session layers in the layer stack in strong-to-weak order.

double GetTimeCodesPerSecond ( ) const
inline

Return the time codes per second value of the layer stack.

This is usually the same as the computed time codes per second of the root layer but may be computed from the session layer when its present.

Definition at line 129 of file layerStack.h.

PCP_API bool HasLayer ( const SdfLayerHandle &  layer) const

Returns true if this layer stack contains the given layer, false otherwise.


The documentation for this class was generated from the following file: