DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::snbmodules::notification_type Struct Reference

#include <notification_enum.hpp>

Public Types

enum  e_notification_type {
  CONNECTION_REQUEST , NEW_TRANSFER , UPDATE_REQUEST , GROUP_METADATA ,
  TRANSFER_ERROR , START_TRANSFER , TRANSFER_METADATA , PAUSE_TRANSFER ,
  RESUME_TRANSFER , CANCEL_TRANSFER
}
 Different type of notifications possible to send. More...
 

Static Public Member Functions

static std::string notification_to_string (e_notification_type e)
 
static std::optional< e_notification_typestring_to_notification (std::string s)
 

Detailed Description

Definition at line 17 of file notification_enum.hpp.

Member Enumeration Documentation

◆ e_notification_type

Different type of notifications possible to send.

Enumerator
CONNECTION_REQUEST 
NEW_TRANSFER 
UPDATE_REQUEST 
GROUP_METADATA 
TRANSFER_ERROR 
START_TRANSFER 
TRANSFER_METADATA 
PAUSE_TRANSFER 
RESUME_TRANSFER 
CANCEL_TRANSFER 

Definition at line 20 of file notification_enum.hpp.

Member Function Documentation

◆ notification_to_string()

static std::string dunedaq::snbmodules::notification_type::notification_to_string ( e_notification_type e)
inlinestatic

Definition at line 39 of file notification_enum.hpp.

40 {
41 const std::map<e_notification_type, std::string> MyEnumStrings{
42 { CONNECTION_REQUEST, "CONNECTION_REQUEST" }, { NEW_TRANSFER, "NEW_TRANSFER" },
43 { UPDATE_REQUEST, "UPDATE_REQUEST" }, { GROUP_METADATA, "GROUP_METADATA" },
44 { TRANSFER_ERROR, "TRANSFER_ERROR" }, { START_TRANSFER, "START_TRANSFER" },
45 { TRANSFER_METADATA, "TRANSFER_METADATA" }, { PAUSE_TRANSFER, "PAUSE_TRANSFER" },
46 { RESUME_TRANSFER, "RESUME_TRANSFER" }, { CANCEL_TRANSFER, "CANCEL_TRANSFER" }
47 };
48 auto it = MyEnumStrings.find(e);
49 return it == MyEnumStrings.end() ? "Not supported" : it->second;
50 }

◆ string_to_notification()

static std::optional< e_notification_type > dunedaq::snbmodules::notification_type::string_to_notification ( std::string s)
inlinestatic

Definition at line 52 of file notification_enum.hpp.

53 {
54 const std::map<std::string, e_notification_type> MyStringsEnum{
55 { "CONNECTION_REQUEST", CONNECTION_REQUEST }, { "NEW_TRANSFER", NEW_TRANSFER },
56 { "UPDATE_REQUEST", UPDATE_REQUEST }, { "GROUP_METADATA", GROUP_METADATA },
57 { "TRANSFER_ERROR", TRANSFER_ERROR }, { "START_TRANSFER", START_TRANSFER },
58 { "TRANSFER_METADATA", TRANSFER_METADATA }, { "PAUSE_TRANSFER", PAUSE_TRANSFER },
59 { "RESUME_TRANSFER", RESUME_TRANSFER }, { "CANCEL_TRANSFER", CANCEL_TRANSFER }
60 };
61 auto it = MyStringsEnum.find(s);
62 if (it == MyStringsEnum.end()) {
63 return std::nullopt;
64 }
65 return it->second;
66 }

The documentation for this struct was generated from the following file: