Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::StandardCopyDefinition< X > Class Template Reference

#include <AbsPtr.h>

Static Public Member Functions

static X * copy (const X *f)
 

Detailed Description

template<class X>
class Heed::StandardCopyDefinition< X >

Definition at line 133 of file AbsPtr.h.

Member Function Documentation

◆ copy()

template<class X >
static X * Heed::StandardCopyDefinition< X >::copy ( const X *  f)
inlinestatic

Definition at line 135 of file AbsPtr.h.

135 {
136#ifdef DEBUG_ACTIVEPTR
137 mcout << "static X* StandardCopyDefinition::copy(const X* f)\n";
138#endif
139 // If to allow the type of copy function be any (void* for example,
140 // it needs to convert it. This seems there is no reason to allow this.
141#ifndef COPY_TYPE_CHECK
142 return f->copy();
143#else
144 X* p = f->copy();
145#ifdef DEBUG_ACTIVEPTR
146 mcout << "X* StandardCopyDefinition::copy(const X* f): f->copy() returned "
147 << p << '\n';
148 mcerr << "Type of X is (in internal notations) " << typeid(X).name()
149 << '\n';
150 mcerr << "Type of *p is (in internal notations) " << typeid(*p).name()
151 << '\n';
152#endif
153 if (typeid(*p) != typeid(*f)) {
154 mcerr << "Error in X* StandardCopyDefinition::copy(const X* f): "
155 << "typeid(*p) != typeid(*f) \n";
156 mcerr << "Type of X is (in internal notations) " << typeid(X).name()
157 << '\n';
158 mcerr << "Type of *p is (in internal notations) " << typeid(*p).name()
159 << '\n';
160 mcerr << "Type of *f is (in internal notations) " << typeid(*f).name()
161 << '\n';
162 mcerr << "Possible reason is omiting of copy function in one of the "
163 "derivative classes\n";
164 spexit(mcerr);
165 }
166 return p;
167#endif
168 }
#define spexit(stream)
Definition: FunNameStack.h:256
#define mcout
Definition: prstream.h:126
#define mcerr
Definition: prstream.h:128

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