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)
 
void 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

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

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

Definition at line 125 of file mapvector.h.

Referenced by libMesh::DistributedMesh::fix_broken_node_and_element_numbering(), and libMesh::DistributedMesh::renumber_dof_objects().

125  {
126  return veclike_iterator(maptype::begin());
127  }
template<typename Val, typename index_t = unsigned int>
const_veclike_iterator libMesh::mapvector< Val, index_t >::begin ( ) const

Definition at line 129 of file mapvector.h.

129  {
130  return const_veclike_iterator(maptype::begin());
131  }
template<typename Val, typename index_t = unsigned int>
veclike_iterator libMesh::mapvector< Val, index_t >::end ( )

Definition at line 133 of file mapvector.h.

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

133  {
134  return veclike_iterator(maptype::end());
135  }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
template<typename Val, typename index_t = unsigned int>
const_veclike_iterator libMesh::mapvector< Val, index_t >::end ( ) const

Definition at line 137 of file mapvector.h.

137  {
138  return const_veclike_iterator(maptype::end());
139  }
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
template<typename Val, typename index_t = unsigned int>
void libMesh::mapvector< Val, index_t >::erase ( index_t  i)

Definition at line 117 of file mapvector.h.

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

117  {
118  maptype::erase(i);
119  }
template<typename Val, typename index_t = unsigned int>
void libMesh::mapvector< Val, index_t >::erase ( const veclike_iterator pos)

Definition at line 121 of file mapvector.h.

121  {
122  maptype::erase(pos.it);
123  }
template<typename Val, typename index_t = unsigned int>
Val& libMesh::mapvector< Val, index_t >::operator[] ( const index_t &  k)

Definition at line 44 of file mapvector.h.

45  {
46  return maptype::operator[](k);
47  }
template<typename Val, typename index_t = unsigned int>
Val libMesh::mapvector< Val, index_t >::operator[] ( const index_t &  k) const

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: