ug4
ug::GeomProvider< TGeom > Class Template Reference

Geom Provider, holding a single instance of a geometry. More...

#include <geom_provider.h>

Classes

struct  LFEIDandQuadOrder
 struct to sort keys More...
 

Public Types

typedef TGeom Type
 type of provided object More...
 

Static Public Member Functions

static void clear ()
 clears all singletons More...
 
static TGeom & get ()
 returns a singleton based on the identifier More...
 
static TGeom & get (const LFEID lfeID, const int quadOrder)
 returns a singleton based on the identifier More...
 

Static Public Attributes

static const bool staticLocalData = TGeom::staticLocalData
 flag indicating if local data may change More...
 

Protected Types

typedef std::map< LFEIDandQuadOrder, TGeom * > MapType
 vector holding instances More...
 

Protected Member Functions

 GeomProvider ()
 private constructor More...
 
 ~GeomProvider ()
 destructor More...
 

Static Protected Member Functions

static void clear_geoms ()
 clears all instances More...
 
static TGeom & get_class (const LFEID lfeID, const int quadOrder)
 returns class based on identifier More...
 
static GeomProvider< TGeom > & inst ()
 singleton provider More...
 

Static Protected Attributes

static MapType m_mLFEIDandOrder = std::map<typename GeomProvider<TGeom>::LFEIDandQuadOrder, TGeom*>()
 

Detailed Description

template<typename TGeom>
class ug::GeomProvider< TGeom >

Geom Provider, holding a single instance of a geometry.

This class is used to wrap an object into a singleton-like provider, such that construction computations is avoided, if the object is used several times.

In addition, the object can be shared between unrelated code parts, if the same object is intended to be used, but no passing is possible or wanted.

Member Typedef Documentation

◆ MapType

template<typename TGeom >
typedef std::map<LFEIDandQuadOrder, TGeom*> ug::GeomProvider< TGeom >::MapType
protected

vector holding instances

◆ Type

template<typename TGeom >
typedef TGeom ug::GeomProvider< TGeom >::Type

type of provided object

Constructor & Destructor Documentation

◆ GeomProvider()

template<typename TGeom >
ug::GeomProvider< TGeom >::GeomProvider ( )
inlineprotected

private constructor

References ug::GeomProvider< TGeom >::m_mLFEIDandOrder.

◆ ~GeomProvider()

template<typename TGeom >
ug::GeomProvider< TGeom >::~GeomProvider ( )
inlineprotected

Member Function Documentation

◆ clear()

template<typename TGeom >
static void ug::GeomProvider< TGeom >::clear ( )
inlinestatic

clears all singletons

References ug::GeomProvider< TGeom >::inst().

◆ clear_geoms()

template<typename TGeom >
static void ug::GeomProvider< TGeom >::clear_geoms ( )
inlinestaticprotected

◆ get() [1/2]

◆ get() [2/2]

template<typename TGeom >
static TGeom& ug::GeomProvider< TGeom >::get ( const LFEID  lfeID,
const int  quadOrder 
)
inlinestatic

◆ get_class()

template<typename TGeom >
static TGeom& ug::GeomProvider< TGeom >::get_class ( const LFEID  lfeID,
const int  quadOrder 
)
inlinestaticprotected

returns class based on identifier

References ug::GeomProvider< TGeom >::m_mLFEIDandOrder, and UG_THROW.

◆ inst()

template<typename TGeom >
static GeomProvider<TGeom>& ug::GeomProvider< TGeom >::inst ( )
inlinestaticprotected

Member Data Documentation

◆ m_mLFEIDandOrder

template<typename TGeom >
std::map< typename GeomProvider< TGeom >::LFEIDandQuadOrder, TGeom * > ug::GeomProvider< TGeom >::m_mLFEIDandOrder = std::map<typename GeomProvider<TGeom>::LFEIDandQuadOrder, TGeom*>()
staticprotected

◆ staticLocalData

template<typename TGeom >
const bool ug::GeomProvider< TGeom >::staticLocalData = TGeom::staticLocalData
static

flag indicating if local data may change

If the local data may change due to run-time setting of trial space or quadrature order, we must store one object for each type. In such a case we must store each combination in some data structure and return the correct one based on the identifier.

Referenced by ug::GeomProvider< TGeom >::get().


The documentation for this class was generated from the following file: