dune-fem  2.4.1-rc
Classes | Public Types | Static Public Member Functions | Static Protected Member Functions | List of all members
Dune::Fem::SingletonList< Key, Object, Factory > Class Template Reference

Singleton list for key/object pairs. More...

#include </local/tomalk/somewhere/tmp/dune-fem/dune/fem/storage/singletonlist.hh>

Classes

class  SingletonListStorage
 

Public Types

typedef Key KeyType
 
typedef Object ObjectType
 
typedef Factory FactoryType
 
typedef std::pair< ObjectType *, unsigned int * > ValueType
 
typedef std::pair< KeyType, ValueTypeListObjType
 

Static Public Member Functions

static ListType & singletonList ()
 
static ObjectTypegetObject (const KeyType &key)
 
static void removeObject (const ObjectType &object)
 
static ValueType getObjFromList (const KeyType &key)
 

Static Protected Member Functions

static void eraseItem (ListIteratorType &it)
 

Detailed Description

template<class Key, class Object, class Factory = DefaultSingletonFactory< Key, Object >>
class Dune::Fem::SingletonList< Key, Object, Factory >

Singleton list for key/object pairs.

A singleton list guarantees that for any valid key at most one object is created.

Parameters
Keytype of keys
Objecttype of objects
Factoryfactory class creating objects from keys. The default just passes the key to the object's constructor.

Member Typedef Documentation

template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
typedef Factory Dune::Fem::SingletonList< Key, Object, Factory >::FactoryType
template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
typedef Key Dune::Fem::SingletonList< Key, Object, Factory >::KeyType
template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
typedef std :: pair< KeyType, ValueType > Dune::Fem::SingletonList< Key, Object, Factory >::ListObjType
template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
typedef Object Dune::Fem::SingletonList< Key, Object, Factory >::ObjectType
template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
typedef std :: pair< ObjectType * , unsigned int * > Dune::Fem::SingletonList< Key, Object, Factory >::ValueType

Member Function Documentation

template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
static void Dune::Fem::SingletonList< Key, Object, Factory >::eraseItem ( ListIteratorType &  it)
inlinestaticprotected
template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
static ObjectType& Dune::Fem::SingletonList< Key, Object, Factory >::getObject ( const KeyType key)
inlinestatic

return reference to the object for given key. If the object does not exist, then it is created first, otherwise the reference counter is increased.

References Dune::Fem::ThreadManager::singleThreadMode().

template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
static ValueType Dune::Fem::SingletonList< Key, Object, Factory >::getObjFromList ( const KeyType key)
inlinestatic
template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
static void Dune::Fem::SingletonList< Key, Object, Factory >::removeObject ( const ObjectType object)
inlinestatic

decrease ref counter for this object, if ref counter is zero, object is deleted

References Dune::Fem::ThreadManager::singleThreadMode().

Referenced by Dune::Fem::ThreadIteratorStorageBase< ThreadIterator< GridPart, pitype > >::~ThreadIteratorStorageBase().

template<class Key , class Object , class Factory = DefaultSingletonFactory< Key, Object >>
static ListType& Dune::Fem::SingletonList< Key, Object, Factory >::singletonList ( )
inlinestatic

list that store pairs of key/object pointers singleton list

list that store pairs of key/object pointers

References Dune::Fem::SingletonList< Key, Object, Factory >::SingletonListStorage::singletonList().


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