Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::CountPP_ns::CountPassivePtr Class Reference

Counter of protected pointers. More...

#include <AbsPtr.h>

Public Member Functions

 CountPassivePtr (const RegPassivePtr *frpp)
 
void book (void)
 
void unbook (void)
 
long get_number_of_booked (void)
 
const RegPassivePtrget_rpp (void)
 
void change_rpp (const RegPassivePtr *frpp)
 
 ~CountPassivePtr ()
 

Detailed Description

Counter of protected pointers.

Definition at line 198 of file AbsPtr.h.

Constructor & Destructor Documentation

◆ CountPassivePtr()

Heed::CountPP_ns::CountPassivePtr::CountPassivePtr ( const RegPassivePtr * frpp)
inline

Definition at line 200 of file AbsPtr.h.

200: rpp(frpp), number_of_booked(0) {}

◆ ~CountPassivePtr()

Heed::CountPP_ns::CountPassivePtr::~CountPassivePtr ( )
inline

Definition at line 815 of file AbsPtr.h.

815 {
816 if (number_of_booked != 0) {
817 mcerr << "Error in CountPassivePtr::~CountPassivePtr():\n"
818 << " number_of_booked != 0, number_of_booked=" << number_of_booked
819 << '\n';
820 if (rpp != NULL)
821 mcerr << (*rpp);
822 else
823 mcerr << "rpp = NULL\n";
824 spexit(mcerr);
825 }
826 if (rpp != NULL) rpp->cpp = NULL;
827}
#define spexit(stream)
#define mcerr
Definition prstream.h:128

Member Function Documentation

◆ book()

void Heed::CountPP_ns::CountPassivePtr::book ( void )
inline

Definition at line 218 of file AbsPtr.h.

218 {
219 if (number_of_booked > LONG_MAX - 1) {
220 mcerr << "Error in CountPassivePtr::book(void):\n"
221 << " too much booked counters, number_of_booked > LONG_MAX-1, "
222 "number_of_booked=" << number_of_booked << '\n';
223 spexit(mcerr);
224 }
225 number_of_booked++;
226}

◆ change_rpp()

void Heed::CountPP_ns::CountPassivePtr::change_rpp ( const RegPassivePtr * frpp)
inline

Definition at line 208 of file AbsPtr.h.

208{ rpp = frpp; }

◆ get_number_of_booked()

long Heed::CountPP_ns::CountPassivePtr::get_number_of_booked ( void )
inline

Definition at line 206 of file AbsPtr.h.

206{ return number_of_booked; }

◆ get_rpp()

const RegPassivePtr * Heed::CountPP_ns::CountPassivePtr::get_rpp ( void )
inline

Definition at line 207 of file AbsPtr.h.

207{ return rpp; }

◆ unbook()

void Heed::CountPP_ns::CountPassivePtr::unbook ( void )
inline

Definition at line 228 of file AbsPtr.h.

228 {
229 if (number_of_booked < 1) {
230 mcerr << "Error in CountPassivePtr::unbook(void):\n"
231 << " number_of_booked < 1, number_of_booked=" << number_of_booked
232 << '\n';
233 spexit(mcerr);
234 }
235 number_of_booked--;
236}

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