Skip to content

Commit

Permalink
STYLE: Make OverRideMap, ObjectFactoryBasePrivate private nested classes
Browse files Browse the repository at this point in the history
Moved the forward-declaration of both `OverRideMap` and
`ObjectFactoryBasePrivate` into the class definition of `ObjectFactoryBase`, as
they are just part of the internal private implementation of `ObjectFactoryBase`.

Follow-up to commit 4c0526e, "STYLE: Make
`SubjectImplementation` a private nested type of itk::Object".
  • Loading branch information
N-Dekker authored and dzenanz committed Sep 27, 2022
1 parent 7357008 commit b85b88b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Modules/Core/Common/include/itkObjectFactoryBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ namespace itk
* \ingroup ITKCommon
*/

// Forward reference because of private implementation
class OverRideMap;
class ObjectFactoryBasePrivate;

class ITKCommon_EXPORT ObjectFactoryBase : public Object
{
public:
Expand Down Expand Up @@ -271,6 +267,10 @@ class ITKCommon_EXPORT ObjectFactoryBase : public Object
~ObjectFactoryBase() override;

private:
// Forward reference because of private implementation
class OverRideMap;
class ObjectFactoryBasePrivate;

/** Set/Get the pointer to ObjectFactoryBasePrivate.
* No concurrent thread safe. */
static void
Expand Down
14 changes: 6 additions & 8 deletions Modules/Core/Common/src/itkObjectFactoryBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace itk
*
*/

class ObjectFactoryBasePrivate : public LightObject
class ObjectFactoryBase::ObjectFactoryBasePrivate : public LightObject
{
public:
~ObjectFactoryBasePrivate() override
Expand All @@ -114,8 +114,8 @@ class ObjectFactoryBasePrivate : public LightObject
bool m_StrictVersionChecking{ false };
};

ObjectFactoryBasePrivate *
ObjectFactoryBase::GetPimplGlobalsPointer()
auto
ObjectFactoryBase::GetPimplGlobalsPointer() -> ObjectFactoryBasePrivate *
{
const auto deleteLambda = []() { m_PimplGlobals->UnRegister(); };
ObjectFactoryBasePrivate * globalInstance =
Expand All @@ -141,10 +141,8 @@ using StringOverMapType = std::multimap<std::string, ObjectFactoryBase::Override
/** \class OverRideMap
* \brief Internal implementation class for ObjectFactorBase.
*/
class OverRideMap : public StringOverMapType
{
public:
};
class ObjectFactoryBase::OverRideMap : public StringOverMapType
{};

/**
* Make possible for application developers to demand an exact match
Expand Down Expand Up @@ -925,5 +923,5 @@ ObjectFactoryBase::GetLibraryPath()
return m_LibraryPath.c_str();
}

ObjectFactoryBasePrivate * ObjectFactoryBase::m_PimplGlobals;
ObjectFactoryBase::ObjectFactoryBasePrivate * ObjectFactoryBase::m_PimplGlobals;
} // end namespace itk

0 comments on commit b85b88b

Please sign in to comment.