libMesh
Classes | Public Types | Public Member Functions | List of all members
libMesh::mapvector< Val, index_t > Class Template Reference

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. More...

#include <mapvector.h>

Inheritance diagram for libMesh::mapvector< Val, index_t >:
[legend]

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 124 of file mapvector.h.

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

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

◆ 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 128 of file mapvector.h.

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

◆ end() [1/2]

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

Definition at line 132 of file mapvector.h.

132  {
133  return veclike_iterator(maptype::end());
134  }

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

◆ 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 136 of file mapvector.h.

136  {
137  return const_veclike_iterator(maptype::end());
138  }

◆ erase() [1/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 120 of file mapvector.h.

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

◆ erase() [2/2]

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

Definition at line 116 of file mapvector.h.

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

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

◆ 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  }

The documentation for this class was generated from the following file:
end
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end.
Definition: variant_filter_iterator.h:343
libMesh::mapvector::veclike_iterator::it
maptype::iterator it
Definition: mapvector.h:80
libMesh::mapvector::end
veclike_iterator end()
Definition: mapvector.h:132