32 #ifndef Foam_defineDebugSwitch_H 33 #define Foam_defineDebugSwitch_H 83 #define registerTemplateDebugSwitchWithName(Type, Name) \ 85 template<> const Foam::RegisterDebugSwitch<Type> \ 86 Foam::RegisterDebugSwitch<Type>::registerDebugSwitch(Name) 90 #define registerDebugSwitchWithName(Type, Tag, Name) \ 92 class add##Tag##ToDebug \ 94 public ::Foam::simpleRegIOobject \ 99 explicit add##Tag##ToDebug(const char* name) \ 101 ::Foam::simpleRegIOobject(::Foam::debug::addDebugObject, name) \ 104 virtual ~add##Tag##ToDebug() = default; \ 106 virtual void readData(::Foam::Istream& is) \ 111 virtual void writeData(::Foam::Ostream& os) const \ 116 add##Tag##ToDebug(const add##Tag##ToDebug&) = delete; \ 117 void operator=(const add##Tag##ToDebug&) = delete; \ 119 add##Tag##ToDebug add##Tag##ToDebug_(Name) 123 #define defineDebugSwitchWithName(Type, Name, Value) \ 124 int Type::debug(::Foam::debug::debugSwitch(Name, Value)) 127 #define defineDebugSwitch(Type, Value) \ 128 defineDebugSwitchWithName(Type, Type::typeName_(), Value); \ 129 registerDebugSwitchWithName(Type, Type, Type::typeName_()) 132 #define defineTemplateDebugSwitchWithName(Type, Name, Value) \ 133 template<> defineDebugSwitchWithName(Type, Name, Value); \ 134 registerTemplateDebugSwitchWithName(Type, Name) 138 #define defineTemplateDebugSwitch(Type, Value) \ 139 defineTemplateDebugSwitchWithName(Type, #Type, Value) 142 #define defineNamedTemplateDebugSwitch(Type, Value) \ 143 defineTemplateDebugSwitchWithName(Type, Type::typeName_(), Value) 150 #define defineTemplate2DebugSwitchWithName(Type, Name, Value) \ 151 defineTemplateDebugSwitchWithName(Type, Name, Value) 154 #define defineTemplate2DebugSwitch(Type, Value) \ 155 defineTemplateDebugSwitch(Type, Value) 158 #define defineNamedTemplate2DebugSwitch(Type, Value) \ 159 defineNamedTemplateDebugSwitch(Type, Value) Abstract base class for registered object with I/O. Used in debug symbol registration.
static const RegisterDebugSwitch registerDebugSwitch
The unique RegisterDebugSwitch object.
Define the debug information, lookup as name.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
virtual void writeData(::Foam::Ostream &os) const
An Ostream is an abstract base class for all output systems (streams, files, token lists...
int debug
Static debugging option.
RegisterDebugSwitch(const char *name)
Construct with given registered name.
OBJstream os(runTime.globalPath()/outputName)
virtual ~RegisterDebugSwitch()=default
virtual void readData(::Foam::Istream &is)
void addDebugObject(const char *name, simpleRegIOobject *obj)
Register debug switch read/write object.
void operator=(const RegisterDebugSwitch< Type > &)=delete