OGS
ProcessLib::Assembly::CumulativeStats< Data > Class Template Reference

Detailed Description

template<typename Data>
class ProcessLib::Assembly::CumulativeStats< Data >

Definition at line 90 of file MatrixAssemblyStats.h.

#include <MatrixAssemblyStats.h>

Inheritance diagram for ProcessLib::Assembly::CumulativeStats< Data >:
[legend]
Collaboration diagram for ProcessLib::Assembly::CumulativeStats< Data >:
[legend]

Public Member Functions

std::shared_ptr< CumulativeStats< Data > > clone ()
 CumulativeStats (CumulativeStats< Data > const &other)=delete
 CumulativeStats (CumulativeStats< Data > &other)
 CumulativeStats (CumulativeStats< Data > &&other)
 ~CumulativeStats ()
void print () const

Static Public Member Functions

static std::shared_ptr< CumulativeStats< Data > > create (const int num_threads)

Public Attributes

Data data {}

Private Types

using Base = std::enable_shared_from_this<CumulativeStats<Data>>

Private Member Functions

 CumulativeStats (const int num_threads)

Private Attributes

std::shared_ptr< CumulativeStats< Data > > parent_
std::shared_ptr< std::mutex > parent_mutex_
int num_threads_

Member Typedef Documentation

◆ Base

template<typename Data>
using ProcessLib::Assembly::CumulativeStats< Data >::Base = std::enable_shared_from_this<CumulativeStats<Data>>
private

Definition at line 93 of file MatrixAssemblyStats.h.

Constructor & Destructor Documentation

◆ CumulativeStats() [1/4]

template<typename Data>
ProcessLib::Assembly::CumulativeStats< Data >::CumulativeStats ( CumulativeStats< Data > const & other)
delete

◆ CumulativeStats() [2/4]

template<typename Data>
ProcessLib::Assembly::CumulativeStats< Data >::CumulativeStats ( CumulativeStats< Data > & other)
inline

Definition at line 113 of file MatrixAssemblyStats.h.

References CumulativeStats(), num_threads_, parent_, and parent_mutex_.

◆ CumulativeStats() [3/4]

template<typename Data>
ProcessLib::Assembly::CumulativeStats< Data >::CumulativeStats ( CumulativeStats< Data > && other)
inline

◆ ~CumulativeStats()

template<typename Data>
ProcessLib::Assembly::CumulativeStats< Data >::~CumulativeStats ( )
inline

Definition at line 129 of file MatrixAssemblyStats.h.

130 {
131 if (!parent_)
132 {
133 return;
134 }
135
136 if (num_threads_ == 1)
137 {
138 parent_->data += data;
139 return;
140 }
141
143
144 DBUG("Adding cumulative stats to parent.");
145
146 parent_->data += data;
147 }
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22

References data, DBUG(), num_threads_, parent_, and parent_mutex_.

◆ CumulativeStats() [4/4]

template<typename Data>
ProcessLib::Assembly::CumulativeStats< Data >::CumulativeStats ( const int num_threads)
inlineexplicitprivate

Definition at line 152 of file MatrixAssemblyStats.h.

References num_threads_, and parent_mutex_.

Member Function Documentation

◆ clone()

template<typename Data>
std::shared_ptr< CumulativeStats< Data > > ProcessLib::Assembly::CumulativeStats< Data >::clone ( )
inline

Definition at line 106 of file MatrixAssemblyStats.h.

107 {
109 }

◆ create()

template<typename Data>
std::shared_ptr< CumulativeStats< Data > > ProcessLib::Assembly::CumulativeStats< Data >::create ( const int num_threads)
inlinestatic

Definition at line 98 of file MatrixAssemblyStats.h.

99 {
102 }
CumulativeStats(CumulativeStats< Data > const &other)=delete

References CumulativeStats().

◆ print()

template<typename Data>
void ProcessLib::Assembly::CumulativeStats< Data >::print ( ) const
inline

Definition at line 149 of file MatrixAssemblyStats.h.

149{ data.print(); }

References data.

Member Data Documentation

◆ data

template<typename Data>
Data ProcessLib::Assembly::CumulativeStats< Data >::data {}

Definition at line 96 of file MatrixAssemblyStats.h.

96{};

Referenced by CumulativeStats(), ~CumulativeStats(), and print().

◆ num_threads_

template<typename Data>
int ProcessLib::Assembly::CumulativeStats< Data >::num_threads_
private

◆ parent_

template<typename Data>
std::shared_ptr<CumulativeStats<Data> > ProcessLib::Assembly::CumulativeStats< Data >::parent_
private

Definition at line 158 of file MatrixAssemblyStats.h.

Referenced by CumulativeStats(), CumulativeStats(), and ~CumulativeStats().

◆ parent_mutex_

template<typename Data>
std::shared_ptr<std::mutex> ProcessLib::Assembly::CumulativeStats< Data >::parent_mutex_
private

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