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

#include <status_enum.hpp>

Public Types

enum  e_status {
  PREPARING , ERROR , SUCCESS_UPLOAD , SUCCESS_DOWNLOAD ,
  FINISHED , CANCELLED , PAUSED , WAITING ,
  CHECKING , HASHING , UPLOADING , DOWNLOADING
}
 Different type of session status Need to be sorted by priority (highest last) More...
 

Static Public Member Functions

static std::string status_to_string (e_status e)
 
static std::optional< e_statusstring_to_status (std::string s)
 

Detailed Description

Definition at line 17 of file status_enum.hpp.

Member Enumeration Documentation

◆ e_status

Different type of session status Need to be sorted by priority (highest last)

Enumerator
PREPARING 

waiting for the transfer to start, can be waiting to receive expected files metadata

ERROR 
SUCCESS_UPLOAD 
SUCCESS_DOWNLOAD 
FINISHED 
CANCELLED 
PAUSED 
WAITING 
CHECKING 
HASHING 
UPLOADING 
DOWNLOADING 

Definition at line 21 of file status_enum.hpp.

22 {
25 PREPARING, // when the file is not yet available to execute transfer and need more time (ex: torrent file is being
26 // generated)
27 ERROR,
28
33
34 PAUSED,
35 WAITING,
36
37 // TODO Aug-14-2022 Leo Joly leo.vincent.andre.joly@cern.ch : should we add more status and specify value ?
38
40 HASHING,
43 };
@ PREPARING
waiting for the transfer to start, can be waiting to receive expected files metadata

Member Function Documentation

◆ status_to_string()

static std::string dunedaq::snbmodules::status_type::status_to_string ( e_status e)
inlinestatic

Definition at line 45 of file status_enum.hpp.

46 {
47 const std::map<e_status, std::string> MyEnumStrings{ { PREPARING, "PREPARING" },
48 { ERROR, "ERROR" },
49 { SUCCESS_UPLOAD, "SUCCESS_UPLOAD" },
50 { SUCCESS_DOWNLOAD, "SUCCESS_DOWNLOAD" },
51 { FINISHED, "FINISHED" },
52 { CANCELLED, "CANCELLED" },
53 { PAUSED, "PAUSED" },
54 { WAITING, "WAITING" },
55 { CHECKING, "CHECKING" },
56 { HASHING, "HASHING" },
57 { UPLOADING, "UPLOADING" },
58 { DOWNLOADING, "DOWNLOADING" } };
59 auto it = MyEnumStrings.find(e);
60 return it == MyEnumStrings.end() ? "Not supported" : it->second;
61 }

◆ string_to_status()

static std::optional< e_status > dunedaq::snbmodules::status_type::string_to_status ( std::string s)
inlinestatic

Definition at line 63 of file status_enum.hpp.

64 {
65 const std::map<std::string, e_status> MyStringsEnum{ { "PREPARING", PREPARING },
66 { "ERROR", ERROR },
67 { "SUCCESS_UPLOAD", SUCCESS_UPLOAD },
68 { "SUCCESS_DOWNLOAD", SUCCESS_DOWNLOAD },
69 { "FINISHED", FINISHED },
70 { "CANCELLED", CANCELLED },
71 { "PAUSED", PAUSED },
72 { "WAITING", WAITING },
73 { "CHECKING", CHECKING },
74 { "HASHING", HASHING },
75 { "UPLOADING", UPLOADING },
76 { "DOWNLOADING", DOWNLOADING } };
77 auto it = MyStringsEnum.find(s);
78 if (it == MyStringsEnum.end()) {
79 return std::nullopt;
80 }
81 return it->second;
82 }

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