libMesh
Loading...
Searching...
No Matches
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_reverse_veclike_iterator
 
class  const_veclike_iterator
 
class  veclike_iterator
 

Public Types

typedef std::map< index_t, Val, std::less< index_t >, FastPoolAllocator< std::pair< const index_t, Val > > > maptype
 

Public Member Functions

veclike_iterator find (const index_t &k)
 
const_veclike_iterator find (const index_t &k) const
 
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 42 of file mapvector.h.

Member Typedef Documentation

◆ maptype

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

Definition at line 48 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 193 of file mapvector.h.

194 {
195 return veclike_iterator(maptype::begin());
196 }

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

199 {
200 return const_veclike_iterator(maptype::begin());
201 }

◆ end() [1/2]

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

Definition at line 203 of file mapvector.h.

204 {
205 return veclike_iterator(maptype::end());
206 }

Referenced by libMesh::mapvector< Val, index_t >::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 208 of file mapvector.h.

209 {
210 return const_veclike_iterator(maptype::end());
211 }

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

189 {
190 return veclike_iterator(maptype::erase(pos.it));
191 }

References libMesh::mapvector< Val, index_t >::veclike_iterator::it.

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

184 {
185 maptype::erase(i);
186 }

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

◆ find() [1/2]

template<typename Val , typename index_t = unsigned int>
veclike_iterator libMesh::mapvector< Val, index_t >::find ( const index_t &  k)
inline

Definition at line 162 of file mapvector.h.

163 {
164 return veclike_iterator(maptype::find(k));
165 }

◆ find() [2/2]

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

Definition at line 167 of file mapvector.h.

168 {
169 return const_veclike_iterator(maptype::find(k));
170 }

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

173 {
174 return maptype::operator[](k);
175 }

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

178 {
179 auto it = this->maptype::find(k);
180 return it == this->end().it? Val() : it->second;
181 }
veclike_iterator end()
Definition mapvector.h:203

References libMesh::mapvector< Val, index_t >::end(), and libMesh::mapvector< Val, index_t >::veclike_iterator::it.


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