Project
Loading...
Searching...
No Matches
qconfig.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#include "qconfig_general.h"
16#define QCONFIG_H
17
18#ifndef BeginNamespace
19#define BeginNamespace(name) \
20 namespace name \
21 {
22#define EndNamespace() }
23#endif
24#if !defined(QCONFIG_GPU)
25#define AddOption(name, type, default, optname, optnameshort, help, ...) type name = default;
26#define AddVariable(name, type, default) type name = default;
27#define _AddOptionArray_INTERNAL_EXPAND(...) __VA_ARGS__
28#define AddOptionArray(name, type, count, default, optname, optnameshort, help, ...) type name[count] = {_AddOptionArray_INTERNAL_EXPAND default};
29#define AddOptionVec(name, type, optname, optnameshort, help, ...) std::vector<type> name;
30#else
31#define AddOption(name, type, default, optname, optnameshort, help, ...) type name;
32#define AddVariable(name, type, default) type name;
33#define AddOptionArray(name, type, count, default, optname, optnameshort, help, ...) type name[count];
34#define AddOptionVec(name, type, optname, optnameshort, help, ...) void* name[sizeof(std::vector<type>) / sizeof(void*)];
35#endif
36#ifdef QCONFIG_GENRTC
37#define AddVariableRTC(name, type, default) \
38 static constexpr type name = default; \
39 type _dummy_##name = default;
40#define AddOptionRTC(name, type, default, optname, optnameshort, help, ...) AddVariableRTC(name, type, default)
41#define _AddOptionArray_INTERNAL_EXPAND(...) __VA_ARGS__
42#define AddOptionArrayRTC(name, type, count, default, optname, optnameshort, help, ...) \
43 static constexpr type name[count] = {_AddOptionArray_INTERNAL_EXPAND default}; \
44 type _dummy_##name[count] = {_AddOptionArray_INTERNAL_EXPAND default};
45#else
46#define AddCustomCPP(...) __VA_ARGS__
47#endif
48#define AddOptionSet(name, type, value, optname, optnameshort, help, ...)
49#define AddSubConfig(name, instance) name instance;
50#if !defined(QCONFIG_GENRTC) && !defined(GPUCA_GPUCODE_DEVICE)
51#define BeginConfig(name, instance) \
52 struct name { \
53 bool operator==(const name&) const = default;
54#else
55#define BeginConfig(name, instance) struct name {
56#endif
57#define BeginSubConfig(name, instance, parent, preoptname, preoptnameshort, descr, ...) BeginConfig(name, instance)
58// clang-format off
59#define EndConfig() \
60 };
61// clang-format on
62
63#include "qconfig_wrapinclude.h"