Skip to content

Commit 4246c00

Browse files
committed
STYLE: Declare MersenneTwisterRandomVariateGenerator data private
Aims to simplify the random number generator. Following C++ Core Guidelines, Oct 3, 2024, Avoid `protected` data https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-protected
1 parent 082e0b7 commit 4246c00

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Modules/Core/Common/include/itkMersenneTwisterRandomVariateGenerator.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,14 @@ class ITKCommon_EXPORT MersenneTwisterRandomVariateGenerator : public RandomVari
302302
static IntegerType
303303
hash(time_t t, clock_t c);
304304

305+
private:
306+
/** Only used to synchronize the global variable across static libraries.*/
307+
itkGetGlobalDeclarationMacro(MersenneTwisterGlobals, PimplGlobals);
308+
309+
/** Internal method to actually create a new object. */
310+
static Pointer
311+
CreateInstance();
312+
305313
// Internal state
306314
IntegerType state[StateVectorLength];
307315

@@ -314,14 +322,6 @@ class ITKCommon_EXPORT MersenneTwisterRandomVariateGenerator : public RandomVari
314322
// Seed value
315323
std::atomic<IntegerType> m_Seed{};
316324

317-
private:
318-
/** Only used to synchronize the global variable across static libraries.*/
319-
itkGetGlobalDeclarationMacro(MersenneTwisterGlobals, PimplGlobals);
320-
321-
/** Internal method to actually create a new object. */
322-
static Pointer
323-
CreateInstance();
324-
325325
// Local lock to enable concurrent access to singleton
326326
std::mutex m_InstanceMutex{};
327327

0 commit comments

Comments
 (0)