Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
PTL::CountedObject< CountedType > Class Template Reference

#include <Types.hh>

Public Types

typedef CountedObject< CountedType > this_type
 
typedef CountedObject< void > void_type
 

Static Public Member Functions

static int64_t live ()
 
static constexpr int64_t zero ()
 
static int64_t max_depth ()
 
static void enable (const bool &val)
 
static void set_max_depth (const int64_t &val)
 
static bool is_enabled ()
 
template<typename Tp = CountedType, typename std::enable_if< std::is_same< Tp, void >::value >::type * = nullptr>
static bool enable ()
 
template<typename Tp = CountedType, typename std::enable_if<!std::is_same< Tp, void >::value >::type * = nullptr>
static bool enable ()
 

Protected Member Functions

 CountedObject ()
 
 ~CountedObject ()
 
 CountedObject (const this_type &)
 
 CountedObject (this_type &&)
 

Detailed Description

template<typename CountedType>
class PTL::CountedObject< CountedType >

Definition at line 113 of file Types.hh.

Member Typedef Documentation

◆ this_type

template<typename CountedType >
typedef CountedObject<CountedType> PTL::CountedObject< CountedType >::this_type

Definition at line 116 of file Types.hh.

◆ void_type

template<typename CountedType >
typedef CountedObject<void> PTL::CountedObject< CountedType >::void_type

Definition at line 117 of file Types.hh.

Constructor & Destructor Documentation

◆ CountedObject() [1/3]

template<typename CountedType >
PTL::CountedObject< CountedType >::CountedObject ( )
inlineprotected

Definition at line 146 of file Types.hh.

146{ ++count(); }

◆ ~CountedObject()

template<typename CountedType >
PTL::CountedObject< CountedType >::~CountedObject ( )
inlineprotected

Definition at line 147 of file Types.hh.

147{ --count(); }

◆ CountedObject() [2/3]

template<typename CountedType >
PTL::CountedObject< CountedType >::CountedObject ( const this_type )
inlineprotected

Definition at line 148 of file Types.hh.

148{ ++count(); }

◆ CountedObject() [3/3]

template<typename CountedType >
PTL::CountedObject< CountedType >::CountedObject ( this_type &&  )
inlineexplicitprotected

Definition at line 149 of file Types.hh.

149{ ++count(); }

Member Function Documentation

◆ enable() [1/3]

template<typename CountedType >
template<typename Tp = CountedType, typename std::enable_if< std::is_same< Tp, void >::value >::type * = nullptr>
static bool PTL::CountedObject< CountedType >::enable ( )
inlinestatic

Definition at line 131 of file Types.hh.

132 {
133 return fenabled && fmax_depth > count();
134 }

◆ enable() [2/3]

template<typename CountedType >
template<typename Tp = CountedType, typename std::enable_if<!std::is_same< Tp, void >::value >::type * = nullptr>
static bool PTL::CountedObject< CountedType >::enable ( )
inlinestatic

Definition at line 138 of file Types.hh.

139 {
140 return void_type::is_enabled() && void_type::max_depth() > count() && fenabled &&
141 fmax_depth > count();
142 }
static bool is_enabled()
Definition: Types.hh:127
static int64_t max_depth()
Definition: Types.hh:123

◆ enable() [3/3]

template<typename CountedType >
static void PTL::CountedObject< CountedType >::enable ( const bool &  val)
inlinestatic

Definition at line 125 of file Types.hh.

125{ fenabled = val; }

◆ is_enabled()

template<typename CountedType >
static bool PTL::CountedObject< CountedType >::is_enabled ( )
inlinestatic

Definition at line 127 of file Types.hh.

127{ return fenabled; }

Referenced by PTL::CountedObject< CountedType >::enable().

◆ live()

template<typename CountedType >
static int64_t PTL::CountedObject< CountedType >::live ( )
inlinestatic

Definition at line 121 of file Types.hh.

121{ return count(); }

◆ max_depth()

template<typename CountedType >
static int64_t PTL::CountedObject< CountedType >::max_depth ( )
inlinestatic

Definition at line 123 of file Types.hh.

123{ return fmax_depth; }

Referenced by PTL::CountedObject< CountedType >::enable().

◆ set_max_depth()

template<typename CountedType >
static void PTL::CountedObject< CountedType >::set_max_depth ( const int64_t &  val)
inlinestatic

Definition at line 126 of file Types.hh.

126{ fmax_depth = val; }

◆ zero()

template<typename CountedType >
static constexpr int64_t PTL::CountedObject< CountedType >::zero ( )
inlinestaticconstexpr

Definition at line 122 of file Types.hh.

122{ return static_cast<int64_t>(0); }

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