-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathChannelSpecHelpers.h
More file actions
43 lines (37 loc) · 1.62 KB
/
ChannelSpecHelpers.h
File metadata and controls
43 lines (37 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef FRAMEWORK_CHANNELSPECHELPERS_H
#define FRAMEWORK_CHANNELSPECHELPERS_H
#include "Framework/ChannelSpec.h"
#include <iosfwd>
namespace o2
{
namespace framework
{
/// A few helpers to convert enums to their actual representation in
/// configuration files / GUI / string based APIs. Never too late
/// for C++ to get multimethods.
struct ChannelSpecHelpers {
/// return a ChannelType as a lowercase string
static char const* typeAsString(enum ChannelType type);
/// return a ChannelMethod as a lowercase string
static char const* methodAsString(enum ChannelMethod method);
/// @return a url associated to an InputChannelSpec
static std::string channelUrl(InputChannelSpec const&);
/// @return a url associated to an OutputChannelSpec
static std::string channelUrl(OutputChannelSpec const&);
};
/// Stream operators so that we can use ChannelType with Boost.Test
std::ostream& operator<<(std::ostream& s, ChannelType const& type);
/// Stream operators so that we can use ChannelString with Boost.Test
std::ostream& operator<<(std::ostream& s, ChannelMethod const& method);
} // namespace framework
} // namespace o2
#endif // FRAMEWORK_CHANNELSPECHELPERS_H