CGRA-ME
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
VectorMap< IndexMap, Key, MappedType > Struct Template Reference

Provides some standard map operations, with a fixed size. More...

#include <Collections.h>

Classes

struct  const_iterator
 
struct  iterator
 

Public Types

using value_type = std::pair< Key, MappedType >
 
using DataStore = std::vector< value_type >
 

Public Member Functions

 VectorMap (std::size_t size)
 
 VectorMap (std::size_t size, IndexMap imap)
 
const MappedType & at (const Key &k) const
 
MappedType & at (const Key &k)
 
MappedType & operator[] (const Key &k)
 
std::pair< iterator, bool > insert (value_type vt)
 
iterator find (const Key &k)
 
const_iterator find (const Key &k) const
 
std::size_t count (const Key &k) const
 
iterator end ()
 
const_iterator end () const
 

Private Member Functions

iterator iterAt (const Key &k)
 
const_iterator iterAt (const Key &k) const
 
bool has_data (const_iterator i) const
 

Private Attributes

DataStore data
 
IndexMap imap
 

Detailed Description

template<typename IndexMap, typename Key, typename MappedType>
struct VectorMap< IndexMap, Key, MappedType >

Provides some standard map operations, with a fixed size.

Definition at line 168 of file Collections.h.

Member Typedef Documentation

◆ DataStore

template<typename IndexMap , typename Key , typename MappedType >
using VectorMap< IndexMap, Key, MappedType >::DataStore = std::vector<value_type>

Definition at line 170 of file Collections.h.

◆ value_type

template<typename IndexMap , typename Key , typename MappedType >
using VectorMap< IndexMap, Key, MappedType >::value_type = std::pair<Key, MappedType>

Definition at line 169 of file Collections.h.

Constructor & Destructor Documentation

◆ VectorMap() [1/2]

template<typename IndexMap , typename Key , typename MappedType >
VectorMap< IndexMap, Key, MappedType >::VectorMap ( std::size_t  size)
inline

Definition at line 188 of file Collections.h.

◆ VectorMap() [2/2]

template<typename IndexMap , typename Key , typename MappedType >
VectorMap< IndexMap, Key, MappedType >::VectorMap ( std::size_t  size,
IndexMap  imap 
)
inline

Definition at line 189 of file Collections.h.

Member Function Documentation

◆ at() [1/2]

template<typename IndexMap , typename Key , typename MappedType >
MappedType& VectorMap< IndexMap, Key, MappedType >::at ( const Key &  k)
inline

Definition at line 196 of file Collections.h.

◆ at() [2/2]

template<typename IndexMap , typename Key , typename MappedType >
const MappedType& VectorMap< IndexMap, Key, MappedType >::at ( const Key &  k) const
inline

Definition at line 193 of file Collections.h.

◆ count()

template<typename IndexMap , typename Key , typename MappedType >
std::size_t VectorMap< IndexMap, Key, MappedType >::count ( const Key &  k) const
inline

Definition at line 221 of file Collections.h.

◆ end() [1/2]

template<typename IndexMap , typename Key , typename MappedType >
iterator VectorMap< IndexMap, Key, MappedType >::end ( )
inline

Definition at line 223 of file Collections.h.

◆ end() [2/2]

template<typename IndexMap , typename Key , typename MappedType >
const_iterator VectorMap< IndexMap, Key, MappedType >::end ( ) const
inline

Definition at line 224 of file Collections.h.

◆ find() [1/2]

template<typename IndexMap , typename Key , typename MappedType >
iterator VectorMap< IndexMap, Key, MappedType >::find ( const Key &  k)
inline

Definition at line 212 of file Collections.h.

◆ find() [2/2]

template<typename IndexMap , typename Key , typename MappedType >
const_iterator VectorMap< IndexMap, Key, MappedType >::find ( const Key &  k) const
inline

Definition at line 216 of file Collections.h.

◆ has_data()

template<typename IndexMap , typename Key , typename MappedType >
bool VectorMap< IndexMap, Key, MappedType >::has_data ( const_iterator  i) const
inlineprivate

Definition at line 229 of file Collections.h.

◆ insert()

template<typename IndexMap , typename Key , typename MappedType >
std::pair<iterator, bool> VectorMap< IndexMap, Key, MappedType >::insert ( value_type  vt)
inline

Definition at line 205 of file Collections.h.

◆ iterAt() [1/2]

template<typename IndexMap , typename Key , typename MappedType >
iterator VectorMap< IndexMap, Key, MappedType >::iterAt ( const Key &  k)
inlineprivate

Definition at line 227 of file Collections.h.

◆ iterAt() [2/2]

template<typename IndexMap , typename Key , typename MappedType >
const_iterator VectorMap< IndexMap, Key, MappedType >::iterAt ( const Key &  k) const
inlineprivate

Definition at line 228 of file Collections.h.

◆ operator[]()

template<typename IndexMap , typename Key , typename MappedType >
MappedType& VectorMap< IndexMap, Key, MappedType >::operator[] ( const Key &  k)
inline

Definition at line 199 of file Collections.h.

Member Data Documentation

◆ data

template<typename IndexMap , typename Key , typename MappedType >
DataStore VectorMap< IndexMap, Key, MappedType >::data
private

Definition at line 231 of file Collections.h.

◆ imap

template<typename IndexMap , typename Key , typename MappedType >
IndexMap VectorMap< IndexMap, Key, MappedType >::imap
private

Definition at line 232 of file Collections.h.


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