Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
emul_new_stand.h
Go to the documentation of this file.
1#ifndef EMUL_NEW_STAND_H
2#define EMUL_NEW_STAND_H
3/*
4Copyright (c) 2001 I. B. Smirnov
5
6Permission to use, copy, modify, distribute and sell this file
7and its documentation for any purpose is hereby granted without fee,
8provided that the above copyright notice, this permission notice,
9and notices about any modifications of the original text
10appear in all copies and in supporting documentation.
11It is provided "as is" without express or implied warranty.
12*/
13
14//#define S_ENWSD // switch to emulation of cast operators:
15// instead of static_cast as well as dynamic_cast it will be direct type
16// transformations: ((type)(name))
17
18//#define S_NO_TYPEID // no type identification and therefore no dynamic_cast
19
20#ifndef S_ENWSD // if no emulation
21#define statcast(type, name) static_cast<type>(name)
22#ifdef S_NO_TYPEID
23#define dyncast(type, name) static_cast<type>(name)
24#else
25#define dyncast(type, name) dynamic_cast<type>(name)
26#endif
27#else // emulation
28#define statcast(type, name) ((type)(name))
29#define dyncast(type, name) ((type)(name)) // very bad emulation
30#endif
31
32//#define S_EEXCEPT // sign to emulate exceptions
33
34//#define S_EMUTABLE // sign to emulate mutable directive
35
36#ifdef S_EMUTABLE
37#include "util/FunNameStack.h"
38#define mutable
39// This discards const
40#define convmut(type) \
41 type& t = (type)(*this); \
42 if(&t != this) { \
43 mcerr << "macro convmut(type): emulation of mutable does not work\n"; \
44 spexit(mcerr); \
45 }
46#else
47#define convmut(type) const type& t = (*this);
48#endif
49
50// For compiler of Solaris, to avoid errors:
51// Error: Function templates may not have default parameters.
52// Abbreviation of Ban of Default Parameters in Function Templates
53//#define BAN_DEFAULT_PAR_FUN_TEMPL
54#endif