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

This data type is used when rendering the flat representation (i.e. loop-iterable) representation of the calling-context. The prefix here will be identical to the prefix in the text output. More...

#include "timemory/storage/node.hpp"

+ Collaboration diagram for tim::node::result< Tp >:

Public Types

using uintvector_t = std::vector< uint64_t >
 
using base_type = typename data< Tp >::result_type
 
using stats_type = typename data< Tp >::stats_type
 
using this_type = result< Tp >
 

Public Member Functions

 result ()=default
 
 ~result ()=default
 
 result (const result &)=default
 
 result (result &&) noexcept=default
 
resultoperator= (const result &)=default
 
resultoperator= (result &&) noexcept=default
 
 result (base_type &&_base) noexcept
 
 result (uint64_t _hash, const Tp &_data, const string_t &_prefix, int64_t _depth, uint64_t _rolling, const uintvector_t &_hierarchy, const stats_type &_stats, uint32_t _tid, uint32_t _pid)
 
uint32_t & tid ()
 measurement thread. May be std::numeric_limits<uint16_t>max() (i.e. 65536) if this entry is a combination of multiple threads More...
 
uint32_t & pid ()
 the process identifier of the reporting process, if multiple process data is combined, or the process identifier of the collecting process More...
 
int64_t & depth ()
 depth of the node in the calling-context More...
 
uint64_t & hash ()
 hash identifer of the node More...
 
uint64_t & rolling_hash ()
 the summation of this hash and it's parent hashes More...
 
string_tprefix ()
 the associated string with the hash + indentation and other decoration More...
 
uintvector_thierarchy ()
 an array of the hash value + each parent hash (not serialized) More...
 
Tp & data ()
 reference to the component More...
 
stats_typestats ()
 reference to the associate statistical accumulation of the data (if any) More...
 
uint64_t & id ()
 alias for hash() More...
 
Tp & obj ()
 alias for data() More...
 
const uint32_t & tid () const
 
const uint32_t & pid () const
 
const int64_t & depth () const
 
const uint64_t & hash () const
 
const uint64_t & rolling_hash () const
 
const string_tprefix () const
 
const uintvector_thierarchy () const
 
const Tp & data () const
 
const stats_typestats () const
 
const uint64_t & id () const
 
const Tp & obj () const
 
bool operator== (const this_type &rhs) const
 
bool operator!= (const this_type &rhs) const
 
this_typeoperator+= (const this_type &rhs)
 
this_typeoperator-= (const this_type &rhs)
 

Detailed Description

template<typename Tp>
struct tim::node::result< Tp >

This data type is used when rendering the flat representation (i.e. loop-iterable) representation of the calling-context. The prefix here will be identical to the prefix in the text output.

Template Parameters
TpComponent type

Definition at line 222 of file node.hpp.

Member Typedef Documentation

◆ base_type

template<typename Tp >
using tim::node::result< Tp >::base_type = typename data<Tp>::result_type

Definition at line 225 of file node.hpp.

◆ stats_type

template<typename Tp >
using tim::node::result< Tp >::stats_type = typename data<Tp>::stats_type

Definition at line 226 of file node.hpp.

◆ this_type

template<typename Tp >
using tim::node::result< Tp >::this_type = result<Tp>

Definition at line 227 of file node.hpp.

◆ uintvector_t

template<typename Tp >
using tim::node::result< Tp >::uintvector_t = std::vector<uint64_t>

Definition at line 224 of file node.hpp.

Constructor & Destructor Documentation

◆ result() [1/5]

template<typename Tp >
tim::node::result< Tp >::result ( )
default

◆ ~result()

template<typename Tp >
tim::node::result< Tp >::~result ( )
default

◆ result() [2/5]

template<typename Tp >
tim::node::result< Tp >::result ( const result< Tp > &  )
default

◆ result() [3/5]

template<typename Tp >
tim::node::result< Tp >::result ( result< Tp > &&  )
defaultnoexcept

◆ result() [4/5]

template<typename Tp >
tim::node::result< Tp >::result ( base_type &&  _base)
inlinenoexcept

Definition at line 236 of file node.hpp.

237 : base_type(std::forward<base_type>(_base))
238 {}
typename data< Tp >::result_type base_type
Definition: node.hpp:225

◆ result() [5/5]

template<typename Tp >
tim::node::result< Tp >::result ( uint64_t  _hash,
const Tp &  _data,
const string_t _prefix,
int64_t  _depth,
uint64_t  _rolling,
const uintvector_t _hierarchy,
const stats_type _stats,
uint32_t  _tid,
uint32_t  _pid 
)

Definition at line 453 of file node.hpp.

456: base_type(_tid, _pid, _depth, _id, _rolling, _prefix, _hierarchy, _data, _stats)
457{}
char const std::string & _prefix
Definition: config.cpp:55

Member Function Documentation

◆ data() [1/2]

template<typename Tp >
Tp & tim::node::result< Tp >::data ( )
inline

reference to the component

Definition at line 268 of file node.hpp.

268{ return std::get<7>(*this); }

Referenced by tim::cereal::load(), tim::node::result< Tp >::operator+=(), tim::node::result< Tp >::operator-=(), and tim::cereal::save().

◆ data() [2/2]

template<typename Tp >
const Tp & tim::node::result< Tp >::data ( ) const
inline

Definition at line 286 of file node.hpp.

286{ return std::get<7>(*this); }

◆ depth() [1/2]

template<typename Tp >
int64_t & tim::node::result< Tp >::depth ( )
inline

depth of the node in the calling-context

Definition at line 253 of file node.hpp.

253{ return std::get<2>(*this); }

Referenced by tim::cereal::load(), tim::node::result< Tp >::operator==(), and tim::cereal::save().

◆ depth() [2/2]

template<typename Tp >
const int64_t & tim::node::result< Tp >::depth ( ) const
inline

Definition at line 281 of file node.hpp.

281{ return std::get<2>(*this); }

◆ hash() [1/2]

template<typename Tp >
uint64_t & tim::node::result< Tp >::hash ( )
inline

hash identifer of the node

Definition at line 256 of file node.hpp.

256{ return std::get<3>(*this); }

Referenced by tim::cereal::load(), tim::node::result< Tp >::operator==(), and tim::cereal::save().

◆ hash() [2/2]

template<typename Tp >
const uint64_t & tim::node::result< Tp >::hash ( ) const
inline

Definition at line 282 of file node.hpp.

282{ return std::get<3>(*this); }

◆ hierarchy() [1/2]

template<typename Tp >
uintvector_t & tim::node::result< Tp >::hierarchy ( )
inline

an array of the hash value + each parent hash (not serialized)

Definition at line 265 of file node.hpp.

265{ return std::get<6>(*this); }

◆ hierarchy() [2/2]

template<typename Tp >
const uintvector_t & tim::node::result< Tp >::hierarchy ( ) const
inline

Definition at line 285 of file node.hpp.

285{ return std::get<6>(*this); }

◆ id() [1/2]

template<typename Tp >
uint64_t & tim::node::result< Tp >::id ( )
inline

alias for hash()

Definition at line 274 of file node.hpp.

274{ return std::get<3>(*this); }

◆ id() [2/2]

template<typename Tp >
const uint64_t & tim::node::result< Tp >::id ( ) const
inline

Definition at line 288 of file node.hpp.

288{ return std::get<3>(*this); }

◆ obj() [1/2]

template<typename Tp >
Tp & tim::node::result< Tp >::obj ( )
inline

alias for data()

Definition at line 277 of file node.hpp.

277{ return std::get<7>(*this); }

◆ obj() [2/2]

template<typename Tp >
const Tp & tim::node::result< Tp >::obj ( ) const
inline

Definition at line 289 of file node.hpp.

289{ return std::get<7>(*this); }

◆ operator!=()

template<typename Tp >
bool tim::node::result< Tp >::operator!= ( const this_type rhs) const
inline

Definition at line 297 of file node.hpp.

297{ return !(*this == rhs); }

◆ operator+=()

template<typename Tp >
this_type & tim::node::result< Tp >::operator+= ( const this_type rhs)
inline

Definition at line 299 of file node.hpp.

300 {
301 data() += rhs.data();
302 stats() += rhs.stats();
303 return *this;
304 }
Tp & data()
reference to the component
Definition: node.hpp:268
stats_type & stats()
reference to the associate statistical accumulation of the data (if any)
Definition: node.hpp:271

References tim::node::result< Tp >::data(), and tim::node::result< Tp >::stats().

◆ operator-=()

template<typename Tp >
this_type & tim::node::result< Tp >::operator-= ( const this_type rhs)
inline

Definition at line 306 of file node.hpp.

307 {
308 data() -= rhs.data();
309 stats() -= rhs.stats();
310 return *this;
311 }

References tim::node::result< Tp >::data(), and tim::node::result< Tp >::stats().

◆ operator=() [1/2]

template<typename Tp >
result & tim::node::result< Tp >::operator= ( const result< Tp > &  )
default

◆ operator=() [2/2]

template<typename Tp >
result & tim::node::result< Tp >::operator= ( result< Tp > &&  )
defaultnoexcept

◆ operator==()

template<typename Tp >
bool tim::node::result< Tp >::operator== ( const this_type rhs) const
inline

Definition at line 291 of file node.hpp.

292 {
293 return (depth() == rhs.depth() && hash() == rhs.hash() &&
294 rolling_hash() == rhs.rolling_hash() && prefix() == rhs.prefix());
295 }
int64_t & depth()
depth of the node in the calling-context
Definition: node.hpp:253
string_t & prefix()
the associated string with the hash + indentation and other decoration
Definition: node.hpp:262
uint64_t & hash()
hash identifer of the node
Definition: node.hpp:256
uint64_t & rolling_hash()
the summation of this hash and it's parent hashes
Definition: node.hpp:259

References tim::node::result< Tp >::depth(), tim::node::result< Tp >::hash(), tim::node::result< Tp >::prefix(), and tim::node::result< Tp >::rolling_hash().

◆ pid() [1/2]

template<typename Tp >
uint32_t & tim::node::result< Tp >::pid ( )
inline

the process identifier of the reporting process, if multiple process data is combined, or the process identifier of the collecting process

Definition at line 250 of file node.hpp.

250{ return std::get<1>(*this); }

◆ pid() [2/2]

template<typename Tp >
const uint32_t & tim::node::result< Tp >::pid ( ) const
inline

Definition at line 280 of file node.hpp.

280{ return std::get<1>(*this); }

◆ prefix() [1/2]

template<typename Tp >
string_t & tim::node::result< Tp >::prefix ( )
inline

the associated string with the hash + indentation and other decoration

Definition at line 262 of file node.hpp.

262{ return std::get<5>(*this); }

Referenced by tim::cereal::load(), tim::node::result< Tp >::operator==(), and tim::cereal::save().

◆ prefix() [2/2]

template<typename Tp >
const string_t & tim::node::result< Tp >::prefix ( ) const
inline

Definition at line 284 of file node.hpp.

284{ return std::get<5>(*this); }

◆ rolling_hash() [1/2]

template<typename Tp >
uint64_t & tim::node::result< Tp >::rolling_hash ( )
inline

the summation of this hash and it's parent hashes

Definition at line 259 of file node.hpp.

259{ return std::get<4>(*this); }

Referenced by tim::cereal::load(), tim::node::result< Tp >::operator==(), and tim::cereal::save().

◆ rolling_hash() [2/2]

template<typename Tp >
const uint64_t & tim::node::result< Tp >::rolling_hash ( ) const
inline

Definition at line 283 of file node.hpp.

283{ return std::get<4>(*this); }

◆ stats() [1/2]

template<typename Tp >
stats_type & tim::node::result< Tp >::stats ( )
inline

reference to the associate statistical accumulation of the data (if any)

Definition at line 271 of file node.hpp.

271{ return std::get<8>(*this); }

Referenced by tim::cereal::load(), tim::node::result< Tp >::operator+=(), tim::node::result< Tp >::operator-=(), and tim::cereal::save().

◆ stats() [2/2]

template<typename Tp >
const stats_type & tim::node::result< Tp >::stats ( ) const
inline

Definition at line 287 of file node.hpp.

287{ return std::get<8>(*this); }

◆ tid() [1/2]

template<typename Tp >
uint32_t & tim::node::result< Tp >::tid ( )
inline

measurement thread. May be std::numeric_limits<uint16_t>max() (i.e. 65536) if this entry is a combination of multiple threads

Definition at line 246 of file node.hpp.

246{ return std::get<0>(*this); }

◆ tid() [2/2]

template<typename Tp >
const uint32_t & tim::node::result< Tp >::tid ( ) const
inline

Definition at line 279 of file node.hpp.

279{ return std::get<0>(*this); }

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