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::auto_tuple< Types > Class Template Reference

This is a variadic component wrapper where all components are allocated on the stack and cannot be disabled at runtime. This bundler has the lowest overhead. Accepts unlimited number of template parameters. The constructor starts the components, the destructor stops the components. More...

#include "timemory/variadic/auto_tuple.hpp"

+ Collaboration diagram for tim::auto_tuple< Types >:

Public Types

using this_type = auto_tuple< Types... >
 
using base_type = component_tuple< Types... >
 
using auto_type = this_type
 
using component_type = typename base_type::component_type
 
using type = convert_t< mpl::available_t< concat< Types... > >, auto_tuple<> >
 

Public Member Functions

template<typename... Args>
 auto_tuple (Args &&... args)
 
 ~auto_tuple ()=default
 
 auto_tuple (const auto_tuple &)=default
 
 auto_tuple (auto_tuple &&)=default
 
auto_tupleoperator= (const auto_tuple &)=default
 
auto_tupleoperator= (auto_tuple &&)=default
 
this_typeprint (std::ostream &os, bool _endl=false) const
 

Static Public Member Functions

static constexpr std::size_t size ()
 

Friends

std::ostream & operator<< (std::ostream &os, const this_type &obj)
 

Detailed Description

template<typename... Types>
class tim::auto_tuple< Types >

This is a variadic component wrapper where all components are allocated on the stack and cannot be disabled at runtime. This bundler has the lowest overhead. Accepts unlimited number of template parameters. The constructor starts the components, the destructor stops the components.

Template Parameters
TypesSpecification of the component types to bundle together
void foo()
{
auto bar = bundle_t("foo");
// ...
}
This is a variadic component wrapper where all components are allocated on the stack and cannot be di...
Definition: auto_tuple.hpp:65

The above code will record wall-clock, cpu-clock, and peak-rss. The intermediate storage will happen on the stack and when the destructor is called, it will add itself to the call-graph

Definition at line 62 of file auto_tuple.hpp.

Member Typedef Documentation

◆ auto_type

template<typename... Types>
using tim::auto_tuple< Types >::auto_type = this_type

Definition at line 72 of file auto_tuple.hpp.

◆ base_type

template<typename... Types>
using tim::auto_tuple< Types >::base_type = component_tuple<Types...>

Definition at line 71 of file auto_tuple.hpp.

◆ component_type

template<typename... Types>
using tim::auto_tuple< Types >::component_type = typename base_type::component_type

Definition at line 73 of file auto_tuple.hpp.

◆ this_type

template<typename... Types>
using tim::auto_tuple< Types >::this_type = auto_tuple<Types...>

Definition at line 70 of file auto_tuple.hpp.

◆ type

template<typename... Types>
using tim::auto_tuple< Types >::type = convert_t<mpl::available_t<concat<Types...> >, auto_tuple<> >

Definition at line 74 of file auto_tuple.hpp.

Constructor & Destructor Documentation

◆ auto_tuple() [1/3]

template<typename... Types>
template<typename... Args>
tim::auto_tuple< Types >::auto_tuple ( Args &&...  args)
explicit

Definition at line 99 of file auto_tuple.hpp.

100: poly_base{ std::forward<Args>(args)... }
101{}

◆ ~auto_tuple()

template<typename... Types>
tim::auto_tuple< Types >::~auto_tuple ( )
default

◆ auto_tuple() [2/3]

template<typename... Types>
tim::auto_tuple< Types >::auto_tuple ( const auto_tuple< Types > &  )
default

◆ auto_tuple() [3/3]

template<typename... Types>
tim::auto_tuple< Types >::auto_tuple ( auto_tuple< Types > &&  )
default

Member Function Documentation

◆ operator=() [1/2]

template<typename... Types>
auto_tuple & tim::auto_tuple< Types >::operator= ( auto_tuple< Types > &&  )
default

◆ operator=() [2/2]

template<typename... Types>
auto_tuple & tim::auto_tuple< Types >::operator= ( const auto_tuple< Types > &  )
default

◆ print()

template<typename... Types>
auto_tuple< Types... > & tim::auto_tuple< Types >::print ( std::ostream &  os,
bool  _endl = false 
) const

Definition at line 105 of file auto_tuple.hpp.

106{
107 os << poly_base::m_temporary;
108 if(_endl)
109 os << '\n';
110 return const_cast<this_type&>(*this);
111}
auto_tuple< Types... > this_type
Definition: auto_tuple.hpp:70
const std::string std::ostream * os

References tim::os.

◆ size()

template<typename... Types>
static constexpr std::size_t tim::auto_tuple< Types >::size ( )
inlinestaticconstexpr

Definition at line 86 of file auto_tuple.hpp.

86{ return poly_base::size(); }

Friends And Related Function Documentation

◆ operator<<

template<typename... Types>
std::ostream & operator<< ( std::ostream &  os,
const this_type obj 
)
friend

Definition at line 90 of file auto_tuple.hpp.

91 {
92 obj.print(os, false);
93 return os;
94 }

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