timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT > Class Template Reference

#include "timemory/components/data_tracker/components.hpp"

+ Collaboration diagram for tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >:

Public Types

using value_type = std::pair< LhsT, RhsT >
 
using base_type = std::vector< value_type >
 
using iterator = typename base_type::iterator
 
using const_iterator = typename base_type::const_iterator
 
using hash_type = HashT
 
using key_type = LhsT
 
using mapped_type = RhsT
 

Public Member Functions

template<typename... Args>
 vector_map (Args &&... args)
 
template<typename... Args>
std::pair< iterator, bool > emplace (Args &&... args)
 
iterator find (const key_type &_key)
 
const_iterator find (const key_type &_key) const
 
mapped_typeoperator[] (const key_type &_key)
 

Detailed Description

template<typename InpT, typename Tag>
template<typename LhsT, typename RhsT, typename HashT = std::hash<LhsT>>
class tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >

Definition at line 163 of file components.hpp.

Member Typedef Documentation

◆ base_type

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
using tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::base_type = std::vector<value_type>

Definition at line 167 of file components.hpp.

◆ const_iterator

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
using tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::const_iterator = typename base_type::const_iterator

Definition at line 169 of file components.hpp.

◆ hash_type

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
using tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::hash_type = HashT

Definition at line 170 of file components.hpp.

◆ iterator

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
using tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::iterator = typename base_type::iterator

Definition at line 168 of file components.hpp.

◆ key_type

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
using tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::key_type = LhsT

Definition at line 171 of file components.hpp.

◆ mapped_type

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
using tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::mapped_type = RhsT

Definition at line 172 of file components.hpp.

◆ value_type

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
using tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::value_type = std::pair<LhsT, RhsT>

Definition at line 166 of file components.hpp.

Constructor & Destructor Documentation

◆ vector_map()

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
template<typename... Args>
tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::vector_map ( Args &&...  args)
inline

Definition at line 175 of file components.hpp.

176 : base_type{ std::forward<Args>(args)... }
177 {}
std::vector< value_type > base_type
Definition: components.hpp:167

Member Function Documentation

◆ emplace()

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
template<typename... Args>
std::pair< iterator, bool > tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::emplace ( Args &&...  args)
inline

Definition at line 180 of file components.hpp.

181 {
182 return { base_type::emplace(base_type::end(), std::forward<Args>(args)...),
183 true };
184 }
return _hash_map end()

◆ find() [1/2]

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
iterator tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::find ( const key_type _key)
inline

Definition at line 186 of file components.hpp.

187 {
188 auto _hkey = hash_type{}(_key);
189 for(auto itr = base_type::begin(); itr != base_type::end(); ++itr)
190 {
191 if(hash_type{}(itr->first) == _hkey)
192 return itr;
193 }
194 return base_type::end();
195 }

Referenced by tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::operator[]().

◆ find() [2/2]

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
const_iterator tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::find ( const key_type _key) const
inline

Definition at line 197 of file components.hpp.

198 {
199 auto _hkey = hash_type{}(_key);
200 for(auto itr = base_type::begin(); itr != base_type::end(); ++itr)
201 {
202 if(hash_type{}(itr->first) == _hkey)
203 return itr;
204 }
205 return base_type::end();
206 }

◆ operator[]()

template<typename InpT , typename Tag >
template<typename LhsT , typename RhsT , typename HashT = std::hash<LhsT>>
mapped_type & tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::operator[] ( const key_type _key)
inline

Definition at line 208 of file components.hpp.

208{ return find(_key)->second; }
iterator find(const key_type &_key)
Definition: components.hpp:186

References tim::component::data_tracker< InpT, Tag >::vector_map< LhsT, RhsT, HashT >::find().


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