Project
Loading...
Searching...
No Matches
ConfigParamSpec.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#ifndef FRAMEWORK_CONFIGPARAMSPEC_H
12#define FRAMEWORK_CONFIGPARAMSPEC_H
13
14#include "Framework/Variant.h"
16
17#include <string>
18
19namespace o2::framework
20{
33
34 struct HelpString {
35 const char* c_str() const { return str.c_str(); }
36 std::string str;
37 };
38 template <typename T>
41 {
42 static_assert(std::is_same<T, HelpString>::value,
43 R"(help string must be brace-enclosed, e.g. '{"help"}')");
44 }
45
46 ConfigParamSpec(std::string _name, ParamType _type,
47 Variant _defaultValue, HelpString _help, ConfigParamKind kind_ = ConfigParamKind::kGeneric)
48 : name(_name), type(_type), defaultValue(_defaultValue), help(_help), kind{kind_}
49 {
50 }
51
54 ConfigParamSpec(std::string _name, ParamType _type, HelpString _help)
55 : name(_name), type(_type), defaultValue(VariantType::Empty), help(_help), kind{ConfigParamKind::kGeneric} {}
56
57 bool operator==(ConfigParamSpec const& that) const
58 {
59 return name == that.name && type == that.type;
60 }
61
62 std::string name;
67};
68
69} // namespace o2::framework
70
71#endif // FRAMEWORK_CONFIGPARAMSPEC_H
Variant for configuration parameter storage. Owns stored data.
Definition Variant.h:307
GLuint const GLchar * name
Definition glcorearb.h:781
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
ConfigParamSpec(std::string _name, ParamType _type, Variant _defaultValue, HelpString _help, ConfigParamKind kind_=ConfigParamKind::kGeneric)
bool operator==(ConfigParamSpec const &that) const
ConfigParamSpec(std::string, ParamType, Variant, T)
ConfigParamSpec(std::string _name, ParamType _type, HelpString _help)