CbmRoot
Loading...
Searching...
No Matches
services/histserv/app/ProgramOptions.h
Go to the documentation of this file.
1/* Copyright (C) 2023 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
5#ifndef CBM_SERVICES_HISTSERV_APP_PROGRAMOPTIONS_H
6#define CBM_SERVICES_HISTSERV_APP_PROGRAMOPTIONS_H 1
7
8#include <cstdint>
9#include <string>
10
12{
13
21 public:
23 ProgramOptions(int argc, char* argv[]) { ParseOptions(argc, argv); }
24
26 ProgramOptions(const ProgramOptions&) = default;
27
30
32 ~ProgramOptions() = default;
33
35 [[nodiscard]] const std::string& ComChan() const { return fsChanHistosIn; }
36
38 [[nodiscard]] const int32_t& ComChanZmqRcvHwm() const { return fiHistosInZmqHwm; }
39
41 [[nodiscard]] const int32_t& ComChanZmqRcvTo() const { return fiHistosInZmqRcvToMs; }
42
44 [[nodiscard]] const uint32_t& HttpPort() const { return fuHttpServerPort; }
45
47 [[nodiscard]] const std::string& HistoFile() const { return fsHistoFileName; }
48
50 [[nodiscard]] bool Overwrite() const { return fOverwrite; }
51
53 [[nodiscard]] bool HideGuiCommands() const { return fHideGuiCommands; }
54
56 [[nodiscard]] bool CompressedInput() const { return fCompressedInput; }
57
58 // /** @brief Get configuration file name (YAML format) **/
59 // [[nodiscard]] const std::string& ConfigFile() const { return fConfig; }
60
61 private:
63 void ParseOptions(int argc, char* argv[]);
64
65
66 private: // members
67 std::string fsChanHistosIn = "tcp://127.0.0.1:56800";
68 int32_t fiHistosInZmqHwm = 1;
69 int32_t fiHistosInZmqRcvToMs = 10;
70 uint32_t fuHttpServerPort = 8080;
71 std::string fsHistoFileName = "histos_dump.root";
72 bool fOverwrite = false;
73 bool fHideGuiCommands = false;
74 bool fCompressedInput = false;
75 //std::string fConfig = ""; ///< Configuration file name (YAML format)
76 };
77
78} // namespace cbm::services::histserv
79
80#endif /* CBM_SERVICES_HISTSERV_APP_PROGRAMOPTIONS_H */
int32_t fiHistosInZmqHwm
High-Water Mark, default keep only 1 update in buffer.
bool fOverwrite
Enable overwriting of existing output file.
ProgramOptions & operator=(const ProgramOptions &)=default
Assignment operator forbidden.
uint32_t fuHttpServerPort
HTTP port of the ROOT web server.
const std::string & HistoFile() const
Get output file name (.root format)
ProgramOptions(const ProgramOptions &)=default
Copy constructor forbidden.
bool CompressedInput() const
Get compressed input option.
const int32_t & ComChanZmqRcvHwm() const
Get receive High-Water Mark for interface channel.
bool fCompressedInput
Enables ZSTD stream decompression is available.
int32_t fiHistosInZmqRcvToMs
Timeout in ms: -1 = block, 0 = instant, val = nb ms.
const std::string & ComChan() const
Get interface channel name or hostname + port or whatever or ????? (FIXME: replacement of FairMQ)
ProgramOptions(int argc, char *argv[])
Standard constructor with command line arguments.
const uint32_t & HttpPort() const
Get histo server http port.
bool fHideGuiCommands
Hides (disables) the GUI commands for Reset/Save/Close.
std::string fsHistoFileName
Output file name (ROOT format)
const int32_t & ComChanZmqRcvTo() const
Get receive timeout for interface channel.
void ParseOptions(int argc, char *argv[])
Get configuration file name (YAML format)