DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq
sourcecode
snbmodules
include
snbmodules
common
protocols_enum.hpp
Go to the documentation of this file.
1
9
#ifndef SNBMODULES_INCLUDE_SNBMODULES_COMMON_PROTOCOLS_ENUM_HPP_
10
#define SNBMODULES_INCLUDE_SNBMODULES_COMMON_PROTOCOLS_ENUM_HPP_
11
12
#include <map>
13
#include <optional>
14
#include <string>
15
16
namespace
dunedaq::snbmodules
{
17
struct
protocol_type
18
{
20
enum
e_protocol_type
21
{
22
BITTORRENT
,
23
RCLONE
,
24
SCP
,
25
dummy
,
26
};
27
28
static
std::string
protocols_to_string
(
e_protocol_type
e)
29
{
30
const
std::map<e_protocol_type, std::string> MyEnumStrings{
31
{
BITTORRENT
,
"BITTORRENT"
}, {
RCLONE
,
"RCLONE"
}, {
SCP
,
"SCP"
}, {
dummy
,
"dummy"
}
32
};
33
auto
it = MyEnumStrings.find(e);
34
return
it == MyEnumStrings.end() ?
"Not supported"
: it->second;
35
}
36
37
static
std::optional<e_protocol_type>
string_to_protocols
(std::string s)
38
{
39
const
std::map<std::string, e_protocol_type> MyStringsEnum{
40
{
"BITTORRENT"
,
BITTORRENT
}, {
"RCLONE"
,
RCLONE
}, {
"SCP"
,
SCP
}, {
"dummy"
,
dummy
}
41
};
42
auto
it = MyStringsEnum.find(s);
43
if
(it == MyStringsEnum.end()) {
44
return
std::nullopt;
45
}
46
return
it->second;
47
}
48
};
49
50
}
// namespace dunedaq::snbmodules
51
#endif
// SNBMODULES_INCLUDE_SNBMODULES_COMMON_PROTOCOLS_ENUM_HPP_
dunedaq::snbmodules
Definition
bookkeeper.hpp:30
dunedaq::snbmodules::protocol_type
Definition
protocols_enum.hpp:18
dunedaq::snbmodules::protocol_type::string_to_protocols
static std::optional< e_protocol_type > string_to_protocols(std::string s)
Definition
protocols_enum.hpp:37
dunedaq::snbmodules::protocol_type::e_protocol_type
e_protocol_type
Different type of protocols available for communication.
Definition
protocols_enum.hpp:21
dunedaq::snbmodules::protocol_type::RCLONE
@ RCLONE
Definition
protocols_enum.hpp:23
dunedaq::snbmodules::protocol_type::SCP
@ SCP
Definition
protocols_enum.hpp:24
dunedaq::snbmodules::protocol_type::BITTORRENT
@ BITTORRENT
Definition
protocols_enum.hpp:22
dunedaq::snbmodules::protocol_type::dummy
@ dummy
Definition
protocols_enum.hpp:25
dunedaq::snbmodules::protocol_type::protocols_to_string
static std::string protocols_to_string(e_protocol_type e)
Definition
protocols_enum.hpp:28
Generated on Thu Dec 25 2025 for DUNE-DAQ by
1.12.0