Nektar++
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Nektar::LibUtilities::NekFactory< tKey, tBase, tParam > Class Template Reference

Provides a generic Factory class. More...

#include <NekFactory.hpp>

Classes

struct  ModuleEntry
 Define a struct to hold the information about a module. More...
 

Public Types

typedef std::less< tKey > tPredicator
 Comparison predicator of key. More...
 
typedef std::shared_ptr< tBase > tBaseSharedPtr
 Shared pointer to an object of baseclass type. More...
 
typedef tBaseSharedPtr(* CreatorFunction) (tParam...)
 CreatorFunction type which takes parameter and returns base class shared pointer. More...
 
typedef std::map< tKey, ModuleEntry, tPredicatorTMapFactory
 Factory map between key and module data. More...
 

Public Member Functions

 NekFactory ()=default
 
tBaseSharedPtr CreateInstance (tKey idKey, tParam... args)
 Create an instance of the class referred to by idKey. More...
 
tKey RegisterCreatorFunction (tKey idKey, CreatorFunction classCreator, std::string pDesc="")
 Register a class with the factory. More...
 
bool ModuleExists (tKey idKey)
 Checks if a particular module is available. More...
 
void PrintAvailableClasses (std::ostream &pOut=std::cout)
 Prints the available classes to stdout. More...
 
tKey GetKey (std::string pDesc)
 Retrieves a key, given a description. More...
 
std::string GetClassDescription (tKey idKey)
 Returns the description of a class. More...
 

Protected Member Functions

TMapFactorygetMapFactory ()
 Ensure the factory's map is created. More...
 

Private Member Functions

 NekFactory (const NekFactory &rhs)
 
NekFactoryoperator= (const NekFactory &rhs)
 

Private Attributes

TMapFactory mMapFactory
 

Detailed Description

template<typename tKey, typename tBase, typename... tParam>
class Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >

Provides a generic Factory class.

Implements a generic object factory. Class-types which use an arbitrary number of parameters may be used via C++ variadic templating.

To allow a class to be instantiated by the factory, the following are required in each class definition (in the case of a single parameter):

static [baseclass]* create([paramtype1] &P) {
return new [derivedclass](P);
}
static std::string className;

and outside the class definition in the implementation:

std::string [derivedclass]::className
= Factory<std::string,[baseclass],[paramtype1]>::
RegisterCreatorFunction("[derivedclass]",
[derivedclass]::create,"Description");

The assignment of the static variable className is done through the call to RegisterCreatorFunction, which registers the class with the factory prior to the start of the main() routine.

To create an instance of a derived class, for instance:

[baseclass]* var_name =
Factory<std::string,[baseclass],[paramtype1]>
::CreateInstance("[derivedclass]",Param1);

Definition at line 103 of file NekFactory.hpp.

Member Typedef Documentation

◆ CreatorFunction

template<typename tKey , typename tBase , typename... tParam>
typedef tBaseSharedPtr(* Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreatorFunction) (tParam...)

CreatorFunction type which takes parameter and returns base class shared pointer.

Definition at line 112 of file NekFactory.hpp.

◆ tBaseSharedPtr

template<typename tKey , typename tBase , typename... tParam>
typedef std::shared_ptr<tBase> Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::tBaseSharedPtr

Shared pointer to an object of baseclass type.

Definition at line 109 of file NekFactory.hpp.

◆ TMapFactory

template<typename tKey , typename tBase , typename... tParam>
typedef std::map<tKey, ModuleEntry, tPredicator> Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::TMapFactory

Factory map between key and module data.

Definition at line 130 of file NekFactory.hpp.

◆ tPredicator

template<typename tKey , typename tBase , typename... tParam>
typedef std::less<tKey> Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::tPredicator

Comparison predicator of key.

Definition at line 107 of file NekFactory.hpp.

Constructor & Destructor Documentation

◆ NekFactory() [1/2]

template<typename tKey , typename tBase , typename... tParam>
Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::NekFactory ( )
default

◆ NekFactory() [2/2]

template<typename tKey , typename tBase , typename... tParam>
Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::NekFactory ( const NekFactory< tKey, tBase, tParam > &  rhs)
private

Member Function Documentation

◆ CreateInstance()

template<typename tKey , typename tBase , typename... tParam>
tBaseSharedPtr Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance ( tKey  idKey,
tParam...  args 
)
inline

Create an instance of the class referred to by idKey.

Searches the factory's map for the given key and returns a shared base class pointer to a new instance of the associated class.

Parameters
idKeyKey of class to create.
xParameter to pass to class constructor.
Returns
Base class pointer to new instance.

Definition at line 144 of file NekFactory.hpp.

References Nektar::ErrorUtil::efatal, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::getMapFactory(), Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::ModuleEntry::m_func, NEKERROR, and Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::PrintAvailableClasses().

Referenced by Nektar::NekMeshUtils::CADSystemOCE::AddCurve(), Nektar::NekMeshUtils::CADSystemCFI::AddCurve(), Nektar::NekMeshUtils::CADSystemOCE::AddSurf(), Nektar::NekMeshUtils::CADSystemCFI::AddSurf(), Nektar::NekMeshUtils::CADSystemOCE::AddVert(), Nektar::NekMeshUtils::CADSystemCFI::AddVert(), Nektar::SolverUtils::Advection3DHomogeneous1D::Advection3DHomogeneous1D(), Nektar::Utilities::ProcessVarOpti::Analytics(), Nektar::ArtificialDiffusion::ArtificialDiffusion(), Nektar::Utilities::ProcessBL::BoundaryLayer3D(), Nektar::NekMeshUtils::BLMesh::BuildElements(), Nektar::NekMeshUtils::FaceMesh::BuildLocalMesh(), Nektar::Collections::Collection::Collection(), Nektar::CompressibleSolver::CompressibleSolver(), Nektar::LibUtilities::SessionReader::CreateComm(), Nektar::LibUtilities::FieldIO::CreateDefault(), Nektar::LibUtilities::FieldIO::CreateForFile(), Nektar::Thread::ThreadMaster::CreateInstance(), Nektar::SolverUtils::FilterFieldConvert::CreateModules(), Nektar::MultiRegions::GlobalLinSys::CreatePrecon(), Nektar::LinearisedAdvection::DFT(), Nektar::NekMeshUtils::FaceMesh::DiagonalSwap(), Nektar::SolverUtils::Diffusion3DHomogeneous1D::Diffusion3DHomogeneous1D(), Nektar::VortexWaveInteraction::ExecuteRoll(), Nektar::VortexWaveInteraction::ExecuteStreak(), Nektar::VortexWaveInteraction::ExecuteWave(), Nektar::MultiRegions::ExpListHomogeneous1D::ExpListHomogeneous1D(), Nektar::MultiRegions::ExpListHomogeneous2D::ExpListHomogeneous2D(), Nektar::MultiRegions::ExpList::ExtractFileBCs(), Nektar::FieldUtils::Field::FieldIOForFile(), Nektar::Utilities::InputTec::GenElement2D(), Nektar::Utilities::InputStar::GenElement2D(), Nektar::Utilities::InputTec::GenElement3D(), Nektar::Utilities::InputStar::GenElement3D(), Nektar::MultiRegions::ExpList::GenGlobalBndLinSys(), Nektar::MultiRegions::ExpList::GenGlobalLinSys(), Nektar::LibUtilities::Import(), Nektar::CompressibleFlowSystem::InitAdvection(), Nektar::ForcingMovingBody::InitialiseCableModel(), Nektar::Utilities::InputSem::insertEdge(), Nektar::Utilities::ProcessLinear::Invalid(), Nektar::GlobalMapping::Mapping::Load(), main(), Nektar::NekMeshUtils::Generator2D::MakeBL(), Nektar::NekMeshUtils::TetMesh::Mesh(), Nektar::FieldUtils::OutputFld::OutputFromData(), Nektar::FieldUtils::OutputFld::OutputFromExp(), Nektar::SpatialDomains::MeshGraphHDF5::PartitionMesh(), Nektar::SpatialDomains::MeshGraphXml::PartitionMesh(), Nektar::Utilities::InputMCF::Process(), Nektar::Utilities::InputNekpp::Process(), Nektar::Utilities::InputSem::Process(), Nektar::NekMeshUtils::ProcessLoadCAD::Process(), Nektar::Utilities::InputNek5000::Process(), Nektar::NekMeshUtils::VolumeMesh::Process(), Nektar::Utilities::ProcessOptiExtract::Process(), Nektar::FieldUtils::OutputInfo::Process(), Nektar::Utilities::OutputNekpp::Process(), Nektar::Utilities::ProcessExtrude::Process(), Nektar::Utilities::InputSwan::Process(), Nektar::Utilities::InputVtk::Process(), Nektar::Utilities::ProcessSpherigon::Process(), Nektar::Utilities::ProcessLinear::Process(), Nektar::NekMeshUtils::CFIMesh::Process(), Nektar::Utilities::InputNek::Process(), Nektar::FieldUtils::ProcessPointDataToFld::Process(), Nektar::Utilities::ProcessTetSplit::Process(), Nektar::Utilities::ProcessDetectSurf::Process(), Nektar::Utilities::ProcessExtractSurf::Process(), Nektar::Utilities::ProcessInsertSurface::Process(), Nektar::Utilities::ProcessExtractTetPrismInterface::Process(), Nektar::NekMeshUtils::Generator2D::Process(), Nektar::Utilities::ProcessProjectCAD::Process(), Nektar::SpatialDomains::MeshGraph::Read(), Nektar::SpatialDomains::MeshPartition::ReadExpansions(), Nektar::Utilities::InputGmsh::ReadNextElement(), Nektar::Utilities::InputPly::ReadPly(), Nektar::NekMeshUtils::Module::ReorderPrisms(), Nektar::PulseWavePropagation::SetPulseWaveBoundaryConditions(), Nektar::VelocityCorrectionScheme::SetUpExtrapolation(), Nektar::VelocityCorrectionScheme::SetupFlowrate(), Nektar::UnsteadyAdvectionDiffusion::SetUpSubSteppingTimeIntegration(), Nektar::Stimulus::Stimulus(), Nektar::Utilities::ProcessCurve::v_GenerateEdgeNodes(), Nektar::APE::v_InitObject(), Nektar::VCSMapping::v_InitObject(), Nektar::LinearSWE::v_InitObject(), Nektar::NonlinearSWE::v_InitObject(), Nektar::BidomainRoth::v_InitObject(), Nektar::LEE::v_InitObject(), Nektar::Bidomain::v_InitObject(), Nektar::Monodomain::v_InitObject(), Nektar::MultiRegions::PreconditionerLinearWithLowEnergy::v_InitObject(), Nektar::MultiRegions::PreconditionerLinearWithBlock::v_InitObject(), Nektar::EigenValuesAdvection::v_InitObject(), Nektar::MultiRegions::PreconditionerLinearWithDiag::v_InitObject(), Nektar::NavierStokesCFE::v_InitObject(), Nektar::DiffusionLDGNS::v_InitObject(), Nektar::ImageWarpingSystem::v_InitObject(), Nektar::NonlinearPeregrine::v_InitObject(), Nektar::PulseWavePropagation::v_InitObject(), Nektar::UnsteadyInviscidBurger::v_InitObject(), Nektar::UnsteadyAdvection::v_InitObject(), Nektar::SolverUtils::Driver::v_InitObject(), Nektar::CFLtester::v_InitObject(), Nektar::CompressibleFlowSystem::v_InitObject(), Nektar::IncNavierStokes::v_InitObject(), Nektar::MMFAdvection::v_InitObject(), Nektar::CoupledLinearNS::v_InitObject(), Nektar::SubSteppingExtrapolate::v_SubSteppingTimeIntegration(), Nektar::VariableConverter::VariableConverter(), Nektar::VortexWaveInteraction::VortexWaveInteraction(), Nektar::LibUtilities::Write(), Nektar::FieldUtils::OutputFileBase::WriteFile(), and Nektar::NekMeshUtils::Octree::WriteOctree().

145  {
146 #ifdef NEKTAR_USE_THREAD_SAFETY
147  ReadLock vReadLock(m_mutex);
148 #endif
149 
150  // Now try and find the key in the map.
151  auto it = getMapFactory()->find(idKey);
152 
153  // If successful, check the CreatorFunction is defined and
154  // create a new instance of the class.
155  if (it != getMapFactory()->end())
156  {
157  ModuleEntry *tmp = &(it->second);
158 #ifdef NEKTAR_USE_THREAD_SAFETY
159  vReadLock.unlock();
160 #endif
161 
162  if (tmp->m_func)
163  {
164  try
165  {
166  return tmp->m_func(args...);
167  }
168  catch (const std::string& s)
169  {
170  std::stringstream errstr;
171  errstr << "Unable to create module: " << idKey << "\n";
172  errstr << s;
173  NEKERROR(ErrorUtil::efatal, errstr.str());
174  }
175  }
176  }
177 
178  // If we get this far, the key doesn't exist, so throw an error.
179  std::stringstream errstr;
180  errstr << "No such module: " << idKey << std::endl;
181  PrintAvailableClasses(errstr);
182  NEKERROR(ErrorUtil::efatal, errstr.str());
183  return tBaseSharedPtr();
184  }
std::shared_ptr< tBase > tBaseSharedPtr
Shared pointer to an object of baseclass type.
Definition: NekFactory.hpp:109
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:209
void PrintAvailableClasses(std::ostream &pOut=std::cout)
Prints the available classes to stdout.
Definition: NekFactory.hpp:235
boost::shared_lock< boost::shared_mutex > ReadLock
Definition: Thread.h:323
TMapFactory * getMapFactory()
Ensure the factory&#39;s map is created.
Definition: NekFactory.hpp:302

◆ GetClassDescription()

template<typename tKey , typename tBase , typename... tParam>
std::string Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::GetClassDescription ( tKey  idKey)
inline

Returns the description of a class.

Definition at line 282 of file NekFactory.hpp.

References ASSERTL0, and Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::getMapFactory().

283  {
284 #ifdef NEKTAR_USE_THREAD_SAFETY
285  ReadLock vReadLock(m_mutex);
286 #endif
287 
288  // Now try and find the key in the map.
289  auto it = getMapFactory()->find(idKey);
290 
291  std::stringstream errstr;
292  errstr << "No such module: " << idKey << std::endl;
293  ASSERTL0 (it != getMapFactory()->end(), errstr.str());
294  return it->second.m_desc;
295  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
boost::shared_lock< boost::shared_mutex > ReadLock
Definition: Thread.h:323
TMapFactory * getMapFactory()
Ensure the factory&#39;s map is created.
Definition: NekFactory.hpp:302

◆ GetKey()

template<typename tKey , typename tBase , typename... tParam>
tKey Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::GetKey ( std::string  pDesc)
inline

Retrieves a key, given a description.

Definition at line 261 of file NekFactory.hpp.

References ASSERTL0, and Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::getMapFactory().

262  {
263 #ifdef NEKTAR_USE_THREAD_SAFETY
264  ReadLock vReadLock(m_mutex);
265 #endif
266 
267  for (auto &it : *getMapFactory())
268  {
269  if (it.second.m_desc == pDesc)
270  {
271  return it.first;
272  }
273  }
274  std::string errstr = "Module '" + pDesc + "' is not known.";
275  ASSERTL0(false, errstr);
276  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
boost::shared_lock< boost::shared_mutex > ReadLock
Definition: Thread.h:323
TMapFactory * getMapFactory()
Ensure the factory&#39;s map is created.
Definition: NekFactory.hpp:302

◆ getMapFactory()

template<typename tKey , typename tBase , typename... tParam>
TMapFactory* Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::getMapFactory ( )
inlineprotected

◆ ModuleExists()

template<typename tKey , typename tBase , typename... tParam>
bool Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::ModuleExists ( tKey  idKey)
inline

Checks if a particular module is available.

Definition at line 215 of file NekFactory.hpp.

References Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::getMapFactory().

Referenced by Nektar::LibUtilities::SessionReader::CreateComm(), main(), and Nektar::SpatialDomains::MeshGraphHDF5::PartitionMesh().

216  {
217 #ifdef NEKTAR_USE_THREAD_SAFETY
218  ReadLock vReadLock(m_mutex);
219 #endif
220 
221  // Now try and find the key in the map.
222  auto it = getMapFactory()->find(idKey);
223 
224  if (it != getMapFactory()->end())
225  {
226  return true;
227  }
228  return false;
229  }
boost::shared_lock< boost::shared_mutex > ReadLock
Definition: Thread.h:323
TMapFactory * getMapFactory()
Ensure the factory&#39;s map is created.
Definition: NekFactory.hpp:302

◆ operator=()

template<typename tKey , typename tBase , typename... tParam>
NekFactory& Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::operator= ( const NekFactory< tKey, tBase, tParam > &  rhs)
private

◆ PrintAvailableClasses()

template<typename tKey , typename tBase , typename... tParam>
void Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::PrintAvailableClasses ( std::ostream &  pOut = std::cout)
inline

Prints the available classes to stdout.

Definition at line 235 of file NekFactory.hpp.

References Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::getMapFactory().

Referenced by Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), and main().

236  {
237 #ifdef NEKTAR_USE_THREAD_SAFETY
238  ReadLock vReadLock(m_mutex);
239 #endif
240 
241  pOut << std::endl << "Available classes: " << std::endl;
242  for (auto &it : *getMapFactory())
243  {
244  pOut << " " << it.first;
245  if (it.second.m_desc != "")
246  {
247  pOut << ":" << std::endl << " "
248  << it.second.m_desc << std::endl;
249  }
250  else
251  {
252  pOut << std::endl;
253  }
254  }
255  }
boost::shared_lock< boost::shared_mutex > ReadLock
Definition: Thread.h:323
TMapFactory * getMapFactory()
Ensure the factory&#39;s map is created.
Definition: NekFactory.hpp:302

◆ RegisterCreatorFunction()

template<typename tKey , typename tBase , typename... tParam>
tKey Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::RegisterCreatorFunction ( tKey  idKey,
CreatorFunction  classCreator,
std::string  pDesc = "" 
)
inline

Register a class with the factory.

This function is called by each class in a static context (prior to the execution of main()) and creates an entry for the class in the factory's map.

Parameters
idKeyKey used to reference the class.
classCreatorFunction to call to create an instance of this class.
pDescOptional description of class.
Returns
The given key idKey.

Definition at line 199 of file NekFactory.hpp.

References Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::getMapFactory().

Referenced by Nektar::Collections::BwdTrans_IterPerExp::BwdTrans_IterPerExp(), Nektar::Collections::BwdTrans_NoCollection::BwdTrans_NoCollection(), Nektar::Collections::BwdTrans_StdMat::BwdTrans_StdMat(), Nektar::Utilities::NodeOpti::CalcMinJac(), Nektar::LibUtilities::H5::DataTypeTraits< T >::GetType(), Nektar::Collections::IProductWRTBase_IterPerExp::IProductWRTBase_IterPerExp(), Nektar::Collections::IProductWRTBase_NoCollection::IProductWRTBase_NoCollection(), Nektar::Collections::IProductWRTBase_StdMat::IProductWRTBase_StdMat(), Nektar::Collections::IProductWRTDerivBase_IterPerExp::IProductWRTDerivBase_IterPerExp(), Nektar::Collections::IProductWRTDerivBase_NoCollection::IProductWRTDerivBase_NoCollection(), Nektar::Collections::IProductWRTDerivBase_StdMat::IProductWRTDerivBase_StdMat(), Nektar::Collections::IProductWRTDerivBase_SumFac_Quad::IProductWRTDerivBase_SumFac_Quad(), Nektar::Collections::IProductWRTDerivBase_SumFac_Tri::IProductWRTDerivBase_SumFac_Tri(), Nektar::Utilities::NodeOpti1D3D::Optimise(), Nektar::Utilities::NodeOpti2D2D::Optimise(), Nektar::Collections::PhysDeriv_IterPerExp::PhysDeriv_IterPerExp(), Nektar::Collections::PhysDeriv_NoCollection::PhysDeriv_NoCollection(), Nektar::Collections::PhysDeriv_StdMat::PhysDeriv_StdMat(), Nektar::Collections::PhysDeriv_SumFac_Hex::PhysDeriv_SumFac_Hex(), Nektar::Collections::PhysDeriv_SumFac_Prism::PhysDeriv_SumFac_Prism(), Nektar::Collections::PhysDeriv_SumFac_Pyr::PhysDeriv_SumFac_Pyr(), Nektar::Collections::PhysDeriv_SumFac_Tet::PhysDeriv_SumFac_Tet(), Nektar::Collections::PhysDeriv_SumFac_Tri::PhysDeriv_SumFac_Tri(), Nektar::MultiRegions::PreconditionerDiagonal::v_DoPreconditioner(), Nektar::LibUtilities::TimeIntegrationWrapper::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXOrder1::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXOrder2::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXOrder3::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXOrder4::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXdirk_1_1_1::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXdirk_1_2_1::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXdirk_1_2_2::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXdirk_4_4_3::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXdirk_2_2_2::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXdirk_2_3_3::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXdirk_2_3_2::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXdirk_3_4_3::v_InitObject(), Nektar::LibUtilities::TimeIntegrationForwardEuler::v_InitObject(), Nektar::LibUtilities::TimeIntegrationBackwardEuler::v_InitObject(), Nektar::LibUtilities::TimeIntegrationBDFImplicitOrder1::v_InitObject(), Nektar::LibUtilities::TimeIntegrationBDFImplicitOrder2::v_InitObject(), Nektar::LibUtilities::TimeIntegrationMidpoint::v_InitObject(), Nektar::LibUtilities::TimeIntegrationRungeKutta2::v_InitObject(), Nektar::LibUtilities::TimeIntegrationRungeKutta2_ImprovedEuler::v_InitObject(), Nektar::LibUtilities::TimeIntegrationRungeKutta2_SSP::v_InitObject(), Nektar::LibUtilities::TimeIntegrationRungeKutta3_SSP::v_InitObject(), Nektar::LibUtilities::TimeIntegrationClassicalRungeKutta4::v_InitObject(), Nektar::LibUtilities::TimeIntegrationRungeKutta4::v_InitObject(), Nektar::LibUtilities::TimeIntegrationRungeKutta5::v_InitObject(), Nektar::LibUtilities::TimeIntegrationDIRKOrder2::v_InitObject(), Nektar::LibUtilities::TimeIntegrationDIRKOrder3::v_InitObject(), Nektar::LibUtilities::TimeIntegrationAdamsBashforthOrder2::v_InitObject(), Nektar::LibUtilities::TimeIntegrationAdamsBashforthOrder3::v_InitObject(), Nektar::LibUtilities::TimeIntegrationAdamsBashforthOrder4::v_InitObject(), Nektar::LibUtilities::TimeIntegrationAdamsMoultonOrder2::v_InitObject(), Nektar::LibUtilities::TimeIntegrationIMEXGear::v_InitObject(), and Nektar::LibUtilities::TimeIntegrationCNAB::v_InitObject().

201  {
202 #ifdef NEKTAR_USE_THREAD_SAFETY
203  WriteLock vWriteLock(m_mutex);
204 #endif
205 
206  ModuleEntry e(classCreator, pDesc);
207  getMapFactory()->insert(std::pair<tKey,ModuleEntry>(idKey, e));
208  return idKey;
209  }
boost::unique_lock< boost::shared_mutex > WriteLock
Definition: Thread.h:322
TMapFactory * getMapFactory()
Ensure the factory&#39;s map is created.
Definition: NekFactory.hpp:302

Member Data Documentation

◆ mMapFactory

template<typename tKey , typename tBase , typename... tParam>
TMapFactory Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::mMapFactory
private