Nektar++
Public Types | Public Member Functions | Private Attributes | List of all members
Nektar::MetricFactory Class Reference

Datatype of the NekFactory used to instantiate classes derived from the Advection class. More...

#include <Metric.h>

Public Types

typedef MetricSharedPtr(* CreatorFunction) (TiXmlElement *, bool)
 

Public Member Functions

std::string RegisterCreatorFunction (std::string key, CreatorFunction func)
 
MetricSharedPtr CreateInstance (std::string key, TiXmlElement *elmt, bool generate)
 

Private Attributes

std::map< std::string, CreatorFunctionm_map
 

Detailed Description

Datatype of the NekFactory used to instantiate classes derived from the Advection class.

Definition at line 128 of file Metric.h.

Member Typedef Documentation

◆ CreatorFunction

typedef MetricSharedPtr(* Nektar::MetricFactory::CreatorFunction) (TiXmlElement *, bool)

Definition at line 131 of file Metric.h.

Member Function Documentation

◆ CreateInstance()

MetricSharedPtr Nektar::MetricFactory::CreateInstance ( std::string  key,
TiXmlElement *  elmt,
bool  generate 
)
inline

Definition at line 139 of file Metric.h.

141 {
142 return m_map[key](elmt, generate);
143 }
std::map< std::string, CreatorFunction > m_map
Definition: Metric.h:146

References m_map.

Referenced by main().

◆ RegisterCreatorFunction()

std::string Nektar::MetricFactory::RegisterCreatorFunction ( std::string  key,
CreatorFunction  func 
)
inline

Definition at line 133 of file Metric.h.

134 {
135 m_map[key] = func;
136 return key;
137 }

References m_map.

Member Data Documentation

◆ m_map

std::map<std::string, CreatorFunction> Nektar::MetricFactory::m_map
private

Definition at line 146 of file Metric.h.

Referenced by CreateInstance(), and RegisterCreatorFunction().