libMesh::mapvector< Val, index_t > Class Template Reference

#include <mapvector.h>

Inheritance diagram for libMesh::mapvector< Val, index_t >:

Classes

class  const_veclike_iterator
 
class  veclike_iterator
 

Public Types

typedef std::map< index_t, Val > maptype
 

Public Member Functions

Val & operator[] (const index_t &k)
 
Val operator[] (const index_t &k) const
 
void erase (index_t i)
 
veclike_iterator erase (const veclike_iterator &pos)
 
veclike_iterator begin ()
 
const_veclike_iterator begin () const
 
veclike_iterator end ()
 
const_veclike_iterator end () const
 

Detailed Description

template<typename Val, typename index_t = unsigned int>
class libMesh::mapvector< Val, index_t >

This mapvector templated class is intended to provide the performance characteristics of a std::map with an interface more closely resembling that of a std::vector, for use with DistributedMesh.

Author
Roy H. Stogner

Definition at line 39 of file mapvector.h.

Member Typedef Documentation

◆ maptype

template<typename Val, typename index_t = unsigned int>
typedef std::map<index_t, Val> libMesh::mapvector< Val, index_t >::maptype

Definition at line 42 of file mapvector.h.

Member Function Documentation

◆ begin() [1/2]

template<typename Val, typename index_t = unsigned int>
veclike_iterator libMesh::mapvector< Val, index_t >::begin ( )
inline

Definition at line 125 of file mapvector.h.

Referenced by libMesh::DistributedMesh::renumber_dof_objects().

125  {
126  return veclike_iterator(maptype::begin());
127  }

◆ begin() [2/2]

template<typename Val, typename index_t = unsigned int>
const_veclike_iterator libMesh::mapvector< Val, index_t >::begin ( ) const
inline

Definition at line 129 of file mapvector.h.

129  {
130  return const_veclike_iterator(maptype::begin());
131  }

◆ end() [1/2]

template<typename Val, typename index_t = unsigned int>
veclike_iterator libMesh::mapvector< Val, index_t >::end ( )
inline

Definition at line 133 of file mapvector.h.

Referenced by libMesh::mapvector< libMesh::Elem *, dof_id_type >::operator[](), and libMesh::DistributedMesh::renumber_dof_objects().

133  {
134  return veclike_iterator(maptype::end());
135  }
IterBase * end

◆ end() [2/2]

template<typename Val, typename index_t = unsigned int>
const_veclike_iterator libMesh::mapvector< Val, index_t >::end ( ) const
inline

Definition at line 137 of file mapvector.h.

137  {
138  return const_veclike_iterator(maptype::end());
139  }
IterBase * end

◆ erase() [1/2]

template<typename Val, typename index_t = unsigned int>
void libMesh::mapvector< Val, index_t >::erase ( index_t  i)
inline

Definition at line 117 of file mapvector.h.

Referenced by libMesh::DistributedMesh::renumber_dof_objects().

117  {
118  maptype::erase(i);
119  }

◆ erase() [2/2]

template<typename Val, typename index_t = unsigned int>
veclike_iterator libMesh::mapvector< Val, index_t >::erase ( const veclike_iterator pos)
inline

Definition at line 121 of file mapvector.h.

121  {
122  return veclike_iterator(maptype::erase(pos.it));
123  }

◆ operator[]() [1/2]

template<typename Val, typename index_t = unsigned int>
Val& libMesh::mapvector< Val, index_t >::operator[] ( const index_t &  k)
inline

Definition at line 44 of file mapvector.h.

45  {
46  return maptype::operator[](k);
47  }

◆ operator[]() [2/2]

template<typename Val, typename index_t = unsigned int>
Val libMesh::mapvector< Val, index_t >::operator[] ( const index_t &  k) const
inline

Definition at line 48 of file mapvector.h.

49  {
50  typename maptype::const_iterator it = this->find(k);
51  return it == this->end().it? Val() : it->second;
52  }
veclike_iterator end()
Definition: mapvector.h:133

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