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::scope::destructor Struct Reference

provides an object which can be returned from functions that will execute the lambda provided during construction when it is destroyed More...

#include "timemory/utility/types.hpp"

+ Collaboration diagram for tim::scope::destructor:

Public Member Functions

template<typename FuncT >
 destructor (FuncT &&_func)
 
 destructor (const destructor &)=delete
 
destructoroperator= (const destructor &)=delete
 
 destructor (destructor &&rhs) noexcept
 
destructoroperator= (destructor &&rhs) noexcept
 
 ~destructor ()
 

Detailed Description

provides an object which can be returned from functions that will execute the lambda provided during construction when it is destroyed

Definition at line 699 of file types.hpp.

Constructor & Destructor Documentation

◆ destructor() [1/3]

template<typename FuncT >
tim::scope::destructor::destructor ( FuncT &&  _func)
inline

Definition at line 702 of file types.hpp.

703 : m_functor(std::forward<FuncT>(_func))
704 {}

◆ destructor() [2/3]

tim::scope::destructor::destructor ( const destructor )
delete

◆ destructor() [3/3]

tim::scope::destructor::destructor ( destructor &&  rhs)
inlinenoexcept

Definition at line 711 of file types.hpp.

712 : m_functor(std::move(rhs.m_functor))
713 {
714 rhs.m_functor = []() {};
715 }

◆ ~destructor()

tim::scope::destructor::~destructor ( )
inline

Definition at line 727 of file types.hpp.

727{ m_functor(); }

Member Function Documentation

◆ operator=() [1/2]

destructor & tim::scope::destructor::operator= ( const destructor )
delete

◆ operator=() [2/2]

destructor & tim::scope::destructor::operator= ( destructor &&  rhs)
inlinenoexcept

Definition at line 717 of file types.hpp.

718 {
719 if(this != &rhs)
720 {
721 m_functor = std::move(rhs.m_functor);
722 rhs.m_functor = []() {};
723 }
724 return *this;
725 }

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