timemory  3.2.1
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::base_data< Tp, 1 > Struct Template Reference

#include "timemory/components/base/data.hpp"

+ Collaboration diagram for tim::component::base_data< Tp, 1 >:

Public Types

using empty_type = std::tuple<>
 
using value_type = Tp
 
using accum_type = empty_type
 
using last_type = empty_type
 

Public Member Functions

const value_typeget_value () const
 
const value_typeget_accum () const
 
const value_typeget_last () const
 
void set_value (value_type v)
 
void set_accum (value_type)
 
void set_last (value_type)
 
 base_data ()=default
 
 ~base_data ()=default
 
base_dataoperator= (base_data &&)=default
 
 base_data (base_data &&)=default
 
 base_data (const base_data &)=default
 
base_dataoperator= (const base_data &)=default
 
template<typename ArchiveT >
void serialize (ArchiveT &ar, const unsigned int=0)
 
value_typeload (bool)
 
const value_typeload (bool) const
 
void plus (const value_type &lhs)
 
void minus (const value_type &lhs)
 
void multiply (const value_type &lhs)
 
void divide (const value_type &lhs)
 
template<typename Up >
auto plus (Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(), void())
 
template<typename Up >
auto minus (Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(), void())
 
template<typename Up >
auto multiply (Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(), void())
 
template<typename Up >
auto divide (Up &&rhs) -> decltype((void) std::forward< Up >(rhs).get_value(), void())
 
value_typeaccum ()
 
value_typelast ()
 

Protected Member Functions

void reset ()
 

Protected Attributes

value_type value = Tp{}
 

Detailed Description

template<typename Tp>
struct tim::component::base_data< Tp, 1 >

Definition at line 95 of file data.hpp.

Member Typedef Documentation

◆ accum_type

template<typename Tp >
using tim::component::base_data< Tp, 1 >::accum_type = empty_type

Definition at line 99 of file data.hpp.

◆ empty_type

template<typename Tp >
using tim::component::base_data< Tp, 1 >::empty_type = std::tuple<>

Definition at line 97 of file data.hpp.

◆ last_type

template<typename Tp >
using tim::component::base_data< Tp, 1 >::last_type = empty_type

Definition at line 100 of file data.hpp.

◆ value_type

template<typename Tp >
using tim::component::base_data< Tp, 1 >::value_type = Tp

Definition at line 98 of file data.hpp.

Constructor & Destructor Documentation

◆ base_data() [1/3]

template<typename Tp >
tim::component::base_data< Tp, 1 >::base_data ( )
default

◆ ~base_data()

template<typename Tp >
tim::component::base_data< Tp, 1 >::~base_data ( )
default

◆ base_data() [2/3]

template<typename Tp >
tim::component::base_data< Tp, 1 >::base_data ( base_data< Tp, 1 > &&  )
default

◆ base_data() [3/3]

template<typename Tp >
tim::component::base_data< Tp, 1 >::base_data ( const base_data< Tp, 1 > &  )
default

Member Function Documentation

◆ accum()

template<typename Tp >
value_type& tim::component::base_data< Tp, 1 >::accum ( )
inline

Definition at line 175 of file data.hpp.

175 { return value; }

◆ divide() [1/2]

template<typename Tp >
void tim::component::base_data< Tp, 1 >::divide ( const value_type lhs)
inline

Definition at line 142 of file data.hpp.

143  {
145  }
static decltype(auto) divide(type &_l, const V &_r)
Definition: math.hpp:1025

References tim::math::compute< Tp, Up >::divide().

◆ divide() [2/2]

template<typename Tp >
template<typename Up >
auto tim::component::base_data< Tp, 1 >::divide ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), void())
inline

Definition at line 168 of file data.hpp.

169  {
170  value =
171  math::compute<value_type>::divide(value, std::forward<Up>(rhs).get_value());
172  }
const value_type & get_value() const
Definition: data.hpp:102

References tim::math::compute< Tp, Up >::divide().

◆ get_accum()

template<typename Tp >
const value_type& tim::component::base_data< Tp, 1 >::get_accum ( ) const
inline

Definition at line 103 of file data.hpp.

103 { return value; }

◆ get_last()

template<typename Tp >
const value_type& tim::component::base_data< Tp, 1 >::get_last ( ) const
inline

Definition at line 104 of file data.hpp.

104 { return value; }

◆ get_value()

template<typename Tp >
const value_type& tim::component::base_data< Tp, 1 >::get_value ( ) const
inline

Definition at line 102 of file data.hpp.

102 { return value; }

◆ last()

template<typename Tp >
value_type& tim::component::base_data< Tp, 1 >::last ( )
inline

Definition at line 178 of file data.hpp.

178 { return value; }

◆ load() [1/2]

template<typename Tp >
value_type& tim::component::base_data< Tp, 1 >::load ( bool  )
inline

Definition at line 124 of file data.hpp.

124 { return value; }

◆ load() [2/2]

template<typename Tp >
const value_type& tim::component::base_data< Tp, 1 >::load ( bool  ) const
inline

Definition at line 125 of file data.hpp.

125 { return value; }

◆ minus() [1/2]

template<typename Tp >
void tim::component::base_data< Tp, 1 >::minus ( const value_type lhs)
inline

Definition at line 132 of file data.hpp.

133  {
135  }
static decltype(auto) minus(type &_l, const V &_r)
Definition: math.hpp:1013

References tim::math::compute< Tp, Up >::minus().

◆ minus() [2/2]

template<typename Tp >
template<typename Up >
auto tim::component::base_data< Tp, 1 >::minus ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), void())
inline

Definition at line 154 of file data.hpp.

155  {
156  value =
157  math::compute<value_type>::minus(value, std::forward<Up>(rhs).get_value());
158  }

References tim::math::compute< Tp, Up >::minus().

◆ multiply() [1/2]

template<typename Tp >
void tim::component::base_data< Tp, 1 >::multiply ( const value_type lhs)
inline

Definition at line 137 of file data.hpp.

138  {
140  }
static decltype(auto) multiply(type &_l, const V &_r)
Definition: math.hpp:1019

References tim::math::compute< Tp, Up >::multiply().

◆ multiply() [2/2]

template<typename Tp >
template<typename Up >
auto tim::component::base_data< Tp, 1 >::multiply ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), void())
inline

Definition at line 161 of file data.hpp.

162  {
163  value =
164  math::compute<value_type>::multiply(value, std::forward<Up>(rhs).get_value());
165  }

References tim::math::compute< Tp, Up >::multiply().

◆ operator=() [1/2]

template<typename Tp >
base_data& tim::component::base_data< Tp, 1 >::operator= ( base_data< Tp, 1 > &&  )
default

◆ operator=() [2/2]

template<typename Tp >
base_data& tim::component::base_data< Tp, 1 >::operator= ( const base_data< Tp, 1 > &  )
default

◆ plus() [1/2]

template<typename Tp >
void tim::component::base_data< Tp, 1 >::plus ( const value_type lhs)
inline

Definition at line 127 of file data.hpp.

128  {
130  }
static decltype(auto) plus(type &_l, const V &_r)
Definition: math.hpp:1007

References tim::math::compute< Tp, Up >::plus().

◆ plus() [2/2]

template<typename Tp >
template<typename Up >
auto tim::component::base_data< Tp, 1 >::plus ( Up &&  rhs) -> decltype((void) std::forward<Up>(rhs).get_value(), void())
inline

Definition at line 148 of file data.hpp.

149  {
150  value = math::compute<value_type>::plus(value, std::forward<Up>(rhs).get_value());
151  }

References tim::math::compute< Tp, Up >::plus().

◆ reset()

template<typename Tp >
void tim::component::base_data< Tp, 1 >::reset ( )
inlineprotected

Definition at line 181 of file data.hpp.

181 { value = Tp{}; }

◆ serialize()

template<typename Tp >
template<typename ArchiveT >
void tim::component::base_data< Tp, 1 >::serialize ( ArchiveT &  ar,
const unsigned int  = 0 
)
inline

Definition at line 119 of file data.hpp.

120  {
121  ar(cereal::make_nvp("value", value));
122  }

◆ set_accum()

template<typename Tp >
void tim::component::base_data< Tp, 1 >::set_accum ( value_type  )
inline

Definition at line 106 of file data.hpp.

106 {}

◆ set_last()

template<typename Tp >
void tim::component::base_data< Tp, 1 >::set_last ( value_type  )
inline

Definition at line 107 of file data.hpp.

107 {}

◆ set_value()

template<typename Tp >
void tim::component::base_data< Tp, 1 >::set_value ( value_type  v)
inline

Definition at line 105 of file data.hpp.

105 { value = v; }

Member Data Documentation

◆ value

template<typename Tp >
value_type tim::component::base_data< Tp, 1 >::value = Tp{}
protected

Definition at line 184 of file data.hpp.


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