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::mpl::execution_handler< BundleT, DataT > Class Template Reference

This is an intermediate type that permits operations such as: More...

#include "timemory/variadic/bundle_execute.hpp"

+ Collaboration diagram for tim::mpl::execution_handler< BundleT, DataT >:

Public Types

using this_type = execution_handler< BundleT, DataT >
 

Public Member Functions

 execution_handler ()=delete
 
 execution_handler (const execution_handler &)=delete
 
execution_handleroperator= (const execution_handler &)=delete
 
 execution_handler (execution_handler &&) noexcept=default
 
execution_handleroperator= (execution_handler &&) noexcept=default
 
 execution_handler (BundleT &_bundle, DataT &&_data) noexcept
 
 operator BundleT () const
 
 operator DataT () const
 
auto get_bundle_and_result ()
 
auto get_bundle () noexcept
 
auto get_result () noexcept
 
auto & return_bundle () noexcept
 
auto return_result () noexcept
 
template<typename... Args>
this_typepush (Args &&... args)
 
template<typename... Args>
this_typepop (Args &&... args)
 
template<typename... Args>
this_typemeasure (Args &&... args)
 
template<typename... Args>
this_typesample (Args &&... args)
 
template<typename... Args>
this_typestart (Args &&... args)
 
template<typename... Args>
this_typestop (Args &&... args)
 
template<typename... Args>
this_typeassemble (Args &&... args)
 
template<typename... Args>
this_typederive (Args &&... args)
 
template<typename... Args>
this_typemark (Args &&... args)
 
template<typename... Args>
this_typemark_begin (Args &&... args)
 
template<typename... Args>
this_typemark_end (Args &&... args)
 
template<typename... Args>
this_typestore (Args &&... args)
 
template<typename... Args>
this_typeaudit (Args &&... args)
 
template<typename... Args>
this_typeadd_secondary (Args &&... args)
 
template<template< typename > class OpT, typename... Args>
this_typeinvoke (Args &&... _args)
 
template<typename... Args>
decltype(auto) get (Args &&... args)
 
template<typename... Args>
decltype(auto) get_labeled (Args &&... args)
 

Detailed Description

template<typename BundleT, typename DataT>
class tim::mpl::execution_handler< BundleT, DataT >

This is an intermediate type that permits operations such as:

Template Parameters
BundleTA component bundler, e.g. component_bundle
DataTThe data type returned from a function that was executed inside the chained member functions calls of BundleT
long fibonacci(long);
long run(long n)
{
return bundle_t{ "run" }.start().execute(fibonacci, n).stop().return_result();
}
long fibonacci(long n)
{
return (n < 2) ? n :
}
This is a variadic component wrapper where all components are allocated on the stack and cannot be di...

Definition at line 72 of file bundle_execute.hpp.

Member Typedef Documentation

◆ this_type

template<typename BundleT , typename DataT >
using tim::mpl::execution_handler< BundleT, DataT >::this_type = execution_handler<BundleT, DataT>

Definition at line 78 of file bundle_execute.hpp.

Constructor & Destructor Documentation

◆ execution_handler() [1/4]

template<typename BundleT , typename DataT >
tim::mpl::execution_handler< BundleT, DataT >::execution_handler ( )
delete

◆ execution_handler() [2/4]

template<typename BundleT , typename DataT >
tim::mpl::execution_handler< BundleT, DataT >::execution_handler ( const execution_handler< BundleT, DataT > &  )
delete

◆ execution_handler() [3/4]

template<typename BundleT , typename DataT >
tim::mpl::execution_handler< BundleT, DataT >::execution_handler ( execution_handler< BundleT, DataT > &&  )
defaultnoexcept

◆ execution_handler() [4/4]

template<typename BundleT , typename DataT >
tim::mpl::execution_handler< BundleT, DataT >::execution_handler ( BundleT &  _bundle,
DataT &&  _data 
)
inlinenoexcept

Definition at line 87 of file bundle_execute.hpp.

88 : m_bundle(_bundle)
89 , m_data(std::move(_data))
90 {}

Member Function Documentation

◆ add_secondary()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::add_secondary ( Args &&...  args)
inline

Definition at line 192 of file bundle_execute.hpp.

193 {
194 m_bundle.add_secondary(std::forward<Args>(args)...);
195 return *this;
196 }

◆ assemble()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::assemble ( Args &&...  args)
inline

Definition at line 150 of file bundle_execute.hpp.

151 {
152 m_bundle.assemble(std::forward<Args>(args)...);
153 return *this;
154 }

◆ audit()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::audit ( Args &&...  args)
inline

Definition at line 186 of file bundle_execute.hpp.

187 {
188 m_bundle.audit(std::forward<Args>(args)...);
189 return *this;
190 }

◆ derive()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::derive ( Args &&...  args)
inline

Definition at line 156 of file bundle_execute.hpp.

157 {
158 m_bundle.derive(std::forward<Args>(args)...);
159 return *this;
160 }

◆ get()

template<typename BundleT , typename DataT >
template<typename... Args>
decltype(auto) tim::mpl::execution_handler< BundleT, DataT >::get ( Args &&...  args)
inline

Definition at line 204 of file bundle_execute.hpp.

205 {
206 return execute(*this, m_bundle.get(std::forward<Args>(args)...));
207 }
auto execute(BundleT &&_bundle, FuncT &&_func, Args &&... _args, enable_if_t< is_invocable< FuncT, Args... >::value &&!std::is_void< std::result_of_t< FuncT(Args...)> >::value, int >)

References tim::mpl::execute().

◆ get_bundle()

template<typename BundleT , typename DataT >
auto tim::mpl::execution_handler< BundleT, DataT >::get_bundle ( )
inlinenoexcept

Definition at line 105 of file bundle_execute.hpp.

105{ return BundleT{ m_bundle }; }

◆ get_bundle_and_result()

template<typename BundleT , typename DataT >
auto tim::mpl::execution_handler< BundleT, DataT >::get_bundle_and_result ( )
inline

Definition at line 103 of file bundle_execute.hpp.

103{ return std::pair<BundleT, DataT>{ m_bundle, m_data }; }

◆ get_labeled()

template<typename BundleT , typename DataT >
template<typename... Args>
decltype(auto) tim::mpl::execution_handler< BundleT, DataT >::get_labeled ( Args &&...  args)
inline

Definition at line 209 of file bundle_execute.hpp.

210 {
211 return execute(*this, m_bundle.get_labeled(std::forward<Args>(args)...));
212 return m_bundle.get_labeled(std::forward<Args>(args)...);
213 }

References tim::mpl::execute().

◆ get_result()

template<typename BundleT , typename DataT >
auto tim::mpl::execution_handler< BundleT, DataT >::get_result ( )
inlinenoexcept

Definition at line 106 of file bundle_execute.hpp.

106{ return DataT{ m_data }; }

◆ invoke()

template<typename BundleT , typename DataT >
template<template< typename > class OpT, typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::invoke ( Args &&...  _args)
inline

Definition at line 198 of file bundle_execute.hpp.

199 {
200 m_bundle.template invoke<OpT>(std::forward<Args>(_args)...);
201 return *this;
202 }
std::array< char *, 4 > _args

References tim::_args.

◆ mark()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::mark ( Args &&...  args)
inline

Definition at line 162 of file bundle_execute.hpp.

163 {
164 m_bundle.mark(std::forward<Args>(args)...);
165 return *this;
166 }

◆ mark_begin()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::mark_begin ( Args &&...  args)
inline

Definition at line 168 of file bundle_execute.hpp.

169 {
170 m_bundle.mark_begin(std::forward<Args>(args)...);
171 return *this;
172 }

◆ mark_end()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::mark_end ( Args &&...  args)
inline

Definition at line 174 of file bundle_execute.hpp.

175 {
176 m_bundle.mark_end(std::forward<Args>(args)...);
177 return *this;
178 }

◆ measure()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::measure ( Args &&...  args)
inline

Definition at line 126 of file bundle_execute.hpp.

127 {
128 m_bundle.measure(std::forward<Args>(args)...);
129 return *this;
130 }

◆ operator BundleT()

template<typename BundleT , typename DataT >
tim::mpl::execution_handler< BundleT, DataT >::operator BundleT ( ) const
inline

Definition at line 92 of file bundle_execute.hpp.

92{ return m_bundle; }

◆ operator DataT()

template<typename BundleT , typename DataT >
tim::mpl::execution_handler< BundleT, DataT >::operator DataT ( ) const
inline

Definition at line 93 of file bundle_execute.hpp.

93{ return m_data; }

◆ operator=() [1/2]

template<typename BundleT , typename DataT >
execution_handler & tim::mpl::execution_handler< BundleT, DataT >::operator= ( const execution_handler< BundleT, DataT > &  )
delete

◆ operator=() [2/2]

template<typename BundleT , typename DataT >
execution_handler & tim::mpl::execution_handler< BundleT, DataT >::operator= ( execution_handler< BundleT, DataT > &&  )
defaultnoexcept

◆ pop()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::pop ( Args &&...  args)
inline

Definition at line 120 of file bundle_execute.hpp.

121 {
122 m_bundle.pop(std::forward<Args>(args)...);
123 return *this;
124 }

◆ push()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::push ( Args &&...  args)
inline

Definition at line 114 of file bundle_execute.hpp.

115 {
116 m_bundle.push(std::forward<Args>(args)...);
117 return *this;
118 }

◆ return_bundle()

template<typename BundleT , typename DataT >
auto & tim::mpl::execution_handler< BundleT, DataT >::return_bundle ( )
inlinenoexcept

Definition at line 108 of file bundle_execute.hpp.

108{ return m_bundle; }

◆ return_result()

template<typename BundleT , typename DataT >
auto tim::mpl::execution_handler< BundleT, DataT >::return_result ( )
inlinenoexcept

Definition at line 109 of file bundle_execute.hpp.

109{ return std::move(m_data); }

◆ sample()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::sample ( Args &&...  args)
inline

Definition at line 132 of file bundle_execute.hpp.

133 {
134 m_bundle.sample(std::forward<Args>(args)...);
135 return *this;
136 }

◆ start()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::start ( Args &&...  args)
inline

Definition at line 138 of file bundle_execute.hpp.

139 {
140 m_bundle.start(std::forward<Args>(args)...);
141 return *this;
142 }

◆ stop()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::stop ( Args &&...  args)
inline

Definition at line 144 of file bundle_execute.hpp.

145 {
146 m_bundle.stop(std::forward<Args>(args)...);
147 return *this;
148 }

◆ store()

template<typename BundleT , typename DataT >
template<typename... Args>
this_type & tim::mpl::execution_handler< BundleT, DataT >::store ( Args &&...  args)
inline

Definition at line 180 of file bundle_execute.hpp.

181 {
182 m_bundle.store(std::forward<Args>(args)...);
183 return *this;
184 }

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