Skip to content

Commit

Permalink
Make Sdf_LayerRegistry::FindByIdentifier private
Browse files Browse the repository at this point in the history
  • Loading branch information
nvmkuruc committed Aug 15, 2023
1 parent 55a02f3 commit 4ca2387
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pxr/usd/sdf/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3328,8 +3328,8 @@ SdfLayer::_OpenLayerAndUnlockRegistry(
// initialization. But now that the layer is in the registry, we release
// the registry lock to avoid blocking progress of threads working with
// other layers.
TF_VERIFY(_layerRegistry->
FindByIdentifier(layer->GetIdentifier()) == layer,
TF_VERIFY(_layerRegistry->Find(layer->GetIdentifier(),
layer->GetResolvedPath()) == layer,
"Could not find %s", layer->GetIdentifier().c_str());

lock.release();
Expand Down
8 changes: 4 additions & 4 deletions pxr/usd/sdf/layerRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Sdf_LayerRegistry::Find(
SdfLayerHandle foundLayer;

if (Sdf_IsAnonLayerIdentifier(inputLayerPath)) {
foundLayer = FindByIdentifier(inputLayerPath);
foundLayer = _FindByIdentifier(inputLayerPath);
} else {
ArResolver& resolver = ArGetResolver();

Expand All @@ -190,7 +190,7 @@ Sdf_LayerRegistry::Find(
string assetPath, args;
Sdf_SplitIdentifier(inputLayerPath, &assetPath, &args);
if (!resolver.IsContextDependentPath(assetPath)) {
foundLayer = FindByIdentifier(layerPath);
foundLayer = _FindByIdentifier(layerPath);
}

// If the layer path is in repository form and we haven't yet
Expand Down Expand Up @@ -218,7 +218,7 @@ Sdf_LayerRegistry::Find(
}

SdfLayerHandle
Sdf_LayerRegistry::FindByIdentifier(
Sdf_LayerRegistry::_FindByIdentifier(
const string& layerPath) const
{
TRACE_FUNCTION();
Expand All @@ -232,7 +232,7 @@ Sdf_LayerRegistry::FindByIdentifier(
foundLayer = *identifierIt;

TF_DEBUG(SDF_LAYER).Msg(
"Sdf_LayerRegistry::FindByIdentifier('%s') => %s\n",
"Sdf_LayerRegistry::_FindByIdentifier('%s') => %s\n",
layerPath.c_str(),
foundLayer ? "Found" : "Not Found");

Expand Down
9 changes: 4 additions & 5 deletions pxr/usd/sdf/layerRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,14 @@ class Sdf_LayerRegistry
SdfLayerHandle Find(const std::string &layerPath,
const std::string &resolvedPath=std::string()) const;

/// Returns a layer from the registry, consulting the by_identifier index
/// with the \p layerPath as provided.
SdfLayerHandle FindByIdentifier(const std::string& layerPath) const;

/// Returns all valid layers held in the registry as a set.
SdfLayerHandleSet GetLayers() const;

private:

/// Returns a layer from the registry, consulting the by_identifier index
/// with the \p layerPath as provided.
SdfLayerHandle _FindByIdentifier(const std::string& layerPath) const;

// Returns a layer from the registry, consulting the by_repository_path
// index with the \p layerPath as provided.
SdfLayerHandle _FindByRepositoryPath(const std::string& layerPath) const;
Expand Down

0 comments on commit 4ca2387

Please sign in to comment.