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::operation::audit< Tp > Struct Template Reference

The purpose of this operation class is for a component to provide some extra customization within a GOTCHA function. It allows a GOTCHA component to inspect the arguments and the return type of a wrapped function. To add support to a component, define void audit(std::string, context, <Args...>). The first argument is the function name (possibly mangled), the second is either type tim::audit::incoming or tim::audit::outgoing, and the remaining arguments are the corresponding types. More...

#include "timemory/operations/types/audit.hpp"

+ Collaboration diagram for tim::operation::audit< Tp >:

Public Types

using type = Tp
 
using gotcha_data_t = component::gotcha_data
 

Public Member Functions

 TIMEMORY_DELETED_OBJECT (audit) template< typename... Args > audit(type &obj
 
auto operator() (type &obj) const
 
template<typename Up , typename... Args, enable_if_t< concepts::is_phase_id< Up >::value > = 0>
auto operator() (type &obj, const gotcha_data_t &_data, Up &&_phase, Args &&... args) const
 
template<typename Arg , typename... Args, enable_if_t<!std::is_same< decay_t< Arg >, gotcha_data_t >::value > = 0>
auto operator() (type &obj, Arg &&arg, Args &&... args) const
 

Public Attributes

Args && args
 

Detailed Description

template<typename Tp>
struct tim::operation::audit< Tp >

The purpose of this operation class is for a component to provide some extra customization within a GOTCHA function. It allows a GOTCHA component to inspect the arguments and the return type of a wrapped function. To add support to a component, define void audit(std::string, context, <Args...>). The first argument is the function name (possibly mangled), the second is either type tim::audit::incoming or tim::audit::outgoing, and the remaining arguments are the corresponding types.

One such purpose may be to create a custom component that intercepts a malloc and uses the arguments to get the exact allocation size.

Definition at line 59 of file audit.hpp.

Member Typedef Documentation

◆ gotcha_data_t

template<typename Tp >
using tim::operation::audit< Tp >::gotcha_data_t = component::gotcha_data

Definition at line 62 of file audit.hpp.

◆ type

template<typename Tp >
using tim::operation::audit< Tp >::type = Tp

Definition at line 61 of file audit.hpp.

Member Function Documentation

◆ operator()() [1/3]

template<typename Tp >
auto tim::operation::audit< Tp >::operator() ( type obj) const
inline

Definition at line 72 of file audit.hpp.

73 {
74 bool _called = false;
75 sfinae(obj, _called, 0, 0, 0);
76 }

◆ operator()() [2/3]

template<typename Tp >
template<typename Arg , typename... Args, enable_if_t<!std::is_same< decay_t< Arg >, gotcha_data_t >::value > = 0>
auto tim::operation::audit< Tp >::operator() ( type obj,
Arg &&  arg,
Args &&...  args 
) const
inline

Definition at line 101 of file audit.hpp.

102 {
103 bool _called = false;
104 sfinae(obj, _called, 0, 0, 0, std::forward<Arg>(arg),
105 std::forward<Args>(args)...);
106 }

References tim::operation::audit< Tp >::args.

◆ operator()() [3/3]

template<typename Tp >
template<typename Up , typename... Args, enable_if_t< concepts::is_phase_id< Up >::value > = 0>
auto tim::operation::audit< Tp >::operator() ( type obj,
const gotcha_data_t _data,
Up &&  _phase,
Args &&...  args 
) const
inline

Definition at line 80 of file audit.hpp.

82 {
83 bool _called = false;
84 sfinae(obj, _called, 0, 0, 0, _data, std::forward<Up>(_phase),
85 std::forward<Args>(args)...);
86 if(!_called)
87 {
88 sfinae(obj, _called, 0, 0, 0, _data, std::forward<Args>(args)...);
89 if(!_called)
90 {
91 sfinae(obj, _called, 0, 0, 0, std::forward<Up>(_phase),
92 std::forward<Args>(args)...);
93 if(!_called)
94 sfinae(obj, _called, 0, 0, 0, std::forward<Args>(args)...);
95 }
96 }
97 }

References tim::operation::audit< Tp >::args.

◆ TIMEMORY_DELETED_OBJECT()

template<typename Tp >
tim::operation::audit< Tp >::TIMEMORY_DELETED_OBJECT ( audit< Tp >  ) &

Member Data Documentation

◆ args

template<typename Tp >
Args&& tim::operation::audit< Tp >::args
Initial value:
{
(*this)(obj, std::forward<Args>(args)...)

Definition at line 67 of file audit.hpp.

Referenced by tim::operation::audit< Tp >::operator()().


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