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

#include <AbsPtr.h>

Public Member Functions

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

Detailed Description

Definition at line 1029 of file AbsPtr.h.

Constructor & Destructor Documentation

◆ CountPassivePtr()

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

Definition at line 1033 of file AbsPtr.h.

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

◆ ~CountPassivePtr()

CountPP_ns::CountPassivePtr::~CountPassivePtr ( )
inline

Definition at line 1666 of file AbsPtr.h.

1666 {
1667 if (number_of_booked != 0) {
1668 mcerr << "Error in CountPassivePtr::~CountPassivePtr():\n"
1669 << " number_of_booked != 0, number_of_booked=" << number_of_booked
1670 << '\n';
1671 if (rpp != NULL)
1672 mcerr << (*rpp);
1673 else
1674 mcerr << "rpp = NULL\n";
1675 spexit(mcerr);
1676 }
1677 if (rpp != NULL) rpp->cpp = NULL;
1678}
#define spexit(stream)
Definition: FunNameStack.h:536
#define mcerr
Definition: prstream.h:135

Member Function Documentation

◆ book()

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

Definition at line 1054 of file AbsPtr.h.

1054 {
1055 if (number_of_booked > LONG_MAX - 1) {
1056 mcerr << "Error in CountPassivePtr::book(void):\n"
1057 << " too much booked counters, number_of_booked > LONG_MAX-1, "
1058 "number_of_booked=" << number_of_booked << '\n';
1059 spexit(mcerr);
1060 }
1061 number_of_booked++;
1062}

◆ change_rpp()

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

Definition at line 1041 of file AbsPtr.h.

1041{ rpp = frpp; }

◆ get_number_of_booked()

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

Definition at line 1039 of file AbsPtr.h.

1039{ return number_of_booked; }

◆ get_rpp()

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

Definition at line 1040 of file AbsPtr.h.

1040{ return rpp; }

◆ unbook()

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

Definition at line 1064 of file AbsPtr.h.

1064 {
1065 if (number_of_booked < 1) {
1066 mcerr << "Error in CountPassivePtr::unbook(void):\n"
1067 << " number_of_booked < 1, number_of_booked=" << number_of_booked
1068 << '\n';
1069 spexit(mcerr);
1070 }
1071 number_of_booked--;
1072}

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