Project
Loading...
Searching...
No Matches
qconfig_helpers.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#ifndef QCONFIG_HELPERS_H
16#define QCONFIG_HELPERS_H
17
18#include <string>
19#include <sstream>
20
21#define qon_mcat(a, b) a##b
22#define qon_mxcat(a, b) qon_mcat(a, b)
23#define qon_mcat3(a, b, c) a##b##c
24#define qon_mxcat3(a, b, c) qon_mcat3(a, b, c)
25#define qon_mstr(a) #a
26#define qon_mxstr(a) qon_mstr(a)
27#define qon_mexp(...) __VA_ARGS__
28#define qon_mxexp(X) qon_mexp X
29
30namespace qConfig
31{
32template <class T>
33inline std::string print_type(T val)
34{
35 std::ostringstream s;
36 s << val;
37 return s.str();
38};
39template <>
40inline std::string print_type<char>(char val)
41{
42 return std::to_string(val);
43};
44template <>
45inline std::string print_type<int8_t>(int8_t val)
46{
47 return std::to_string(val);
48};
49template <>
50inline std::string print_type<uint8_t>(uint8_t val)
51{
52 return std::to_string(val);
53};
54template <>
55inline std::string print_type<bool>(bool val)
56{
57 return val ? "true" : "false";
58};
59} // namespace qConfig
60
61#endif
GLuint GLfloat * val
Definition glcorearb.h:1582
std::string print_type< bool >(bool val)
std::string print_type(T val)
std::string print_type< uint8_t >(uint8_t val)
std::string print_type< char >(char val)
std::string print_type< int8_t >(int8_t val)
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52