Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CTCounter.hh File Reference

Go to the source code of this file.

Classes

struct  G4Number< N >
 
struct  G4Number< 0 >
 

Macros

#define G4CT_COUNT_INIT(init_value)
 
#define G4CT_MAX_COUNT   255
 
#define G4CT_COUNT(flagName)
 
#define G4CT_COUNT_INIT_DEF(init_value)
 
#define G4CT_COUNT_INIT_IMPL(enumName, init_value)
 
#define G4CT_COUNT_DEF(flagName)
 
#define G4CT_COUNT_IMPL(enumName, flagName)
 

Macro Definition Documentation

◆ G4CT_COUNT

#define G4CT_COUNT ( flagName)
Value:
static constexpr const int flagName = decltype(Counter(G4Number<G4CT_MAX_COUNT>{}))::value; \
{ \
static_assert(flagName + 1 < G4CT_MAX_COUNT, "Maximum enumeration count exeeded"); \
}
#define G4CT_MAX_COUNT

Definition at line 108 of file G4CTCounter.hh.

108#define G4CT_COUNT(flagName) \
109 static constexpr const int flagName = decltype(Counter(G4Number<G4CT_MAX_COUNT>{}))::value; \
110 static constexpr G4Number<flagName + 1> Counter(G4Number<flagName + 1>) \
111 { \
112 static_assert(flagName + 1 < G4CT_MAX_COUNT, "Maximum enumeration count exeeded"); \
113 return G4Number<flagName + 1>{}; \
114 }

◆ G4CT_COUNT_DEF

#define G4CT_COUNT_DEF ( flagName)
Value:
static constexpr const int flagName = \
decltype(Counter(G4Number<G4CT_MAX_COUNT>{}))::value; \
static constexpr G4Number<flagName + 1> \

Definition at line 131 of file G4CTCounter.hh.

131#define G4CT_COUNT_DEF(flagName) \
132 static constexpr const int flagName = \
133 decltype(Counter(G4Number<G4CT_MAX_COUNT>{}))::value; \
134 static constexpr G4Number<flagName + 1> \
135 Counter(G4Number<flagName + 1>);

◆ G4CT_COUNT_IMPL

#define G4CT_COUNT_IMPL ( enumName,
flagName )
Value:

Definition at line 137 of file G4CTCounter.hh.

137#define G4CT_COUNT_IMPL(enumName, flagName) \
138 constexpr G4Number<enumName::flagName + 1> \
139 enumName::Counter(G4Number<enumName::flagName + 1>){ \
140 return G4Number<enumName::flagName +1 >{}; \
141 }

◆ G4CT_COUNT_INIT

#define G4CT_COUNT_INIT ( init_value)
Value:

Definition at line 90 of file G4CTCounter.hh.

90#define G4CT_COUNT_INIT(init_value) \
91 static constexpr G4Number<init_value> \
92 Counter(G4Number<init_value>) { \
93 return G4Number<init_value>(); \
94 }

◆ G4CT_COUNT_INIT_DEF

#define G4CT_COUNT_INIT_DEF ( init_value)
Value:

Definition at line 121 of file G4CTCounter.hh.

121#define G4CT_COUNT_INIT_DEF(init_value) \
122 static constexpr G4Number<init_value> \
123 Counter(G4Number<init_value>);

◆ G4CT_COUNT_INIT_IMPL

#define G4CT_COUNT_INIT_IMPL ( enumName,
init_value )
Value:

Definition at line 125 of file G4CTCounter.hh.

125#define G4CT_COUNT_INIT_IMPL(enumName, init_value) \
126 constexpr G4Number<init_value> \
127 enumName::Counter(G4Number<init_value>){ \
128 return G4Number<init_value>{}; \
129 }

◆ G4CT_MAX_COUNT

#define G4CT_MAX_COUNT   255

Definition at line 100 of file G4CTCounter.hh.