Garfield++ 4.0
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 130 of file AbsPtr.h.

Member Function Documentation

◆ copy()

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

Definition at line 132 of file AbsPtr.h.

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