MFEM  v3.4
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
mfem::NamedFieldsMap< T > Class Template Reference

Lightweight adaptor over an std::map from strings to pointer to T. More...

#include <datacollection.hpp>

Collaboration diagram for mfem::NamedFieldsMap< T >:
[legend]

Public Types

typedef std::map< std::string,
T * > 
MapType
 
typedef MapType::iterator iterator
 
typedef MapType::const_iterator const_iterator
 

Public Member Functions

void Register (const std::string &fname, T *field, bool own_data)
 Register field field with name fname. More...
 
void Deregister (const std::string &fname, bool own_data)
 Unregister association between field field and name fname. More...
 
void DeleteData (bool own_data)
 Clear all associations between names and fields. More...
 
bool Has (const std::string &fname) const
 Predicate to check if a field is associated with name fname. More...
 
T * Get (const std::string &fname) const
 Get a pointer to the field associated with name fname. More...
 
const MapTypeGetMap () const
 Returns a const reference to the underlying map. More...
 
int NumFields () const
 Returns the number of registered fields. More...
 
iterator begin ()
 Returns a begin iterator to the registered fields. More...
 
const_iterator begin () const
 Returns a begin const iterator to the registered fields. More...
 
iterator end ()
 Returns an end iterator to the registered fields. More...
 
const_iterator end () const
 Returns an end const iterator to the registered fields. More...
 
iterator find (const std::string &fname)
 Returns an iterator to the field fname. More...
 
const_iterator find (const std::string &fname) const
 Returns a const iterator to the field fname. More...
 
void clear ()
 Clears the map of registered fields without reclaiming memory. More...
 

Protected Attributes

MapType field_map
 

Detailed Description

template<typename T>
class mfem::NamedFieldsMap< T >

Lightweight adaptor over an std::map from strings to pointer to T.

Definition at line 28 of file datacollection.hpp.

Member Typedef Documentation

template<typename T>
typedef MapType::const_iterator mfem::NamedFieldsMap< T >::const_iterator

Definition at line 33 of file datacollection.hpp.

template<typename T>
typedef MapType::iterator mfem::NamedFieldsMap< T >::iterator

Definition at line 32 of file datacollection.hpp.

template<typename T>
typedef std::map<std::string, T*> mfem::NamedFieldsMap< T >::MapType

Definition at line 31 of file datacollection.hpp.

Member Function Documentation

template<typename T>
iterator mfem::NamedFieldsMap< T >::begin ( )
inline

Returns a begin iterator to the registered fields.

Definition at line 98 of file datacollection.hpp.

template<typename T>
const_iterator mfem::NamedFieldsMap< T >::begin ( ) const
inline

Returns a begin const iterator to the registered fields.

Definition at line 100 of file datacollection.hpp.

template<typename T>
void mfem::NamedFieldsMap< T >::clear ( )
inline

Clears the map of registered fields without reclaiming memory.

Definition at line 116 of file datacollection.hpp.

template<typename T>
void mfem::NamedFieldsMap< T >::DeleteData ( bool  own_data)
inline

Clear all associations between names and fields.

Delete associated pointers when own_data is true

Definition at line 65 of file datacollection.hpp.

template<typename T>
void mfem::NamedFieldsMap< T >::Deregister ( const std::string &  fname,
bool  own_data 
)
inline

Unregister association between field field and name fname.

Optionally delete associated pointer if own_data is true

Definition at line 50 of file datacollection.hpp.

template<typename T>
iterator mfem::NamedFieldsMap< T >::end ( )
inline

Returns an end iterator to the registered fields.

Definition at line 103 of file datacollection.hpp.

template<typename T>
const_iterator mfem::NamedFieldsMap< T >::end ( ) const
inline

Returns an end const iterator to the registered fields.

Definition at line 105 of file datacollection.hpp.

template<typename T>
iterator mfem::NamedFieldsMap< T >::find ( const std::string &  fname)
inline

Returns an iterator to the field fname.

Definition at line 108 of file datacollection.hpp.

template<typename T>
const_iterator mfem::NamedFieldsMap< T >::find ( const std::string &  fname) const
inline

Returns a const iterator to the field fname.

Definition at line 112 of file datacollection.hpp.

template<typename T>
T* mfem::NamedFieldsMap< T >::Get ( const std::string &  fname) const
inline

Get a pointer to the field associated with name fname.

Returns
Pointer to field associated with fname or NULL

Definition at line 85 of file datacollection.hpp.

template<typename T>
const MapType& mfem::NamedFieldsMap< T >::GetMap ( ) const
inline

Returns a const reference to the underlying map.

Definition at line 92 of file datacollection.hpp.

template<typename T>
bool mfem::NamedFieldsMap< T >::Has ( const std::string &  fname) const
inline

Predicate to check if a field is associated with name fname.

Definition at line 78 of file datacollection.hpp.

template<typename T>
int mfem::NamedFieldsMap< T >::NumFields ( ) const
inline

Returns the number of registered fields.

Definition at line 95 of file datacollection.hpp.

template<typename T>
void mfem::NamedFieldsMap< T >::Register ( const std::string &  fname,
T *  field,
bool  own_data 
)
inline

Register field field with name fname.

Replace existing field associated with fname (and optionally delete associated pointer if own_data is true)

Definition at line 38 of file datacollection.hpp.

Member Data Documentation

template<typename T>
MapType mfem::NamedFieldsMap< T >::field_map
protected

Definition at line 119 of file datacollection.hpp.


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