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

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

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

Public Types

using type = Tp
 
using cache_type = typename trait::cache< Tp >::type
 

Public Member Functions

template<typename RetT = cache_type, enable_if_t<!concepts::is_null_type< RetT >::value &&std::is_trivially_constructible< RetT >::value > = 0>
RetT operator() ()
 
template<typename RetT , enable_if_t< std::is_same< RetT, cache_type >::value > = 0>
auto operator() (RetT &&val)
 
template<typename RetT = cache_type, enable_if_t< concepts::is_null_type< RetT >::value > = 0>
void operator() ()
 
template<typename RetT , enable_if_t<!std::is_same< RetT, cache_type >::value||concepts::is_null_type< RetT >::value > = 0>
void operator() (RetT &&val)
 
template<typename Func , typename RetT , enable_if_t< std::is_same< RetT, cache_type >::value &&!concepts::is_null_type< RetT >::value > = 0>
auto operator() (type &_obj, Func &&_func, RetT &&_arg)
 

Detailed Description

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

Definition at line 48 of file cache.hpp.

Member Typedef Documentation

◆ cache_type

Definition at line 51 of file cache.hpp.

◆ type

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

Definition at line 50 of file cache.hpp.

Member Function Documentation

◆ operator()() [1/5]

template<typename Tp >
template<typename RetT = cache_type, enable_if_t<!concepts::is_null_type< RetT >::value &&std::is_trivially_constructible< RetT >::value > = 0>
RetT tim::operation::cache< Tp >::operator() ( )
inline

Definition at line 58 of file cache.hpp.

59 {
60 return RetT{};
61 }

◆ operator()() [2/5]

template<typename Tp >
template<typename RetT = cache_type, enable_if_t< concepts::is_null_type< RetT >::value > = 0>
void tim::operation::cache< Tp >::operator() ( )
inline

Definition at line 71 of file cache.hpp.

72 {}

◆ operator()() [3/5]

template<typename Tp >
template<typename RetT , enable_if_t< std::is_same< RetT, cache_type >::value > = 0>
auto tim::operation::cache< Tp >::operator() ( RetT &&  val)
inline

Definition at line 64 of file cache.hpp.

65 {
66 return std::forward<RetT>(val);
67 }

◆ operator()() [4/5]

template<typename Tp >
template<typename RetT , enable_if_t<!std::is_same< RetT, cache_type >::value||concepts::is_null_type< RetT >::value > = 0>
void tim::operation::cache< Tp >::operator() ( RetT &&  val)
inline

Definition at line 76 of file cache.hpp.

77 {
78 return std::forward<RetT>(val);
79 }

◆ operator()() [5/5]

template<typename Tp >
template<typename Func , typename RetT , enable_if_t< std::is_same< RetT, cache_type >::value &&!concepts::is_null_type< RetT >::value > = 0>
auto tim::operation::cache< Tp >::operator() ( type _obj,
Func &&  _func,
RetT &&  _arg 
)
inline

Definition at line 84 of file cache.hpp.

85 {
86 return ((_obj).*(_func))(std::forward<RetT>(_arg));
87 }

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