DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
defs.hpp
Go to the documentation of this file.
1// DUNE DAQ modification notice:
2// This file has been modified from the original ATLAS oks source for the DUNE DAQ project.
3// Fork baseline commit: oks-08-03-04 (2022-04-14).
4// Renamed since fork: yes (from oks/defs.h to include/oks/defs.hpp).
5
6#ifndef OKS_DEFS_H
7#define OKS_DEFS_H
8
9#include <string>
10#include <iosfwd>
11
12#include "ers/ers.hpp"
13
14#include "oks/exceptions.hpp"
15
16
25
26namespace dunedaq {
27namespace oks
28{
32
33 const std::string
34 strerror(int error);
35
36
38
44
45
46class Oks {
47
48 public:
49
50 static std::ostream& error_msg(const char *);
51 static std::ostream& warning_msg(const char *);
52 static std::ostream& error_msg(const std::string& s) {return error_msg(s.c_str());}
53 static std::ostream& warning_msg(const std::string& s) {return warning_msg(s.c_str());}
54
55 static void substitute_variables(std::string&);
56 static bool real_path(std::string&, bool ignore_errors);
57
58
62
63 class Tokenizer {
64
65 public:
66
67 Tokenizer(const std::string& s, const char * separator);
68 const std::string next();
69 bool next(std::string&);
70
71
72 private:
73
74 std::string p_string;
75 const char * p_delimeters;
76 std::string::size_type p_idx;
77
78 static std::string s_empty;
79 };
80
81};
82
83
84} // namespace oks
85} // namespace dunedaq
86
87
88 // defines MACRO and CONSTANTS for verbose report
89
90#ifndef ERS_NO_DEBUG
91# include <boost/date_time/posix_time/posix_time_types.hpp>
92# include <boost/date_time/posix_time/time_formatters.hpp>
93# define OSK_VERBOSE_REPORT(MSG) if(p_verbose) { boost::posix_time::ptime now = boost::posix_time::second_clock::universal_time(); std::cout << "[OKS " << boost::posix_time::to_simple_string(now) << "]: " << MSG << std::endl; std::cout.flush();}
94#else
95# define OSK_VERBOSE_REPORT(MSG) ;
96#endif
97
98
99 // defines MACRO for OKS profiler
100
101#ifndef ERS_NO_DEBUG
102# define OSK_PROFILING(FID, K) OksFunctionProfiler yyy(FID, K);
103#else
104# define OSK_PROFILING(FID, K) ;
105#endif
106
107#endif
std::string::size_type p_idx
Definition defs.hpp:76
const std::string next()
Definition time.cpp:194
const char * p_delimeters
Definition defs.hpp:75
Tokenizer(const std::string &s, const char *separator)
Definition time.cpp:186
static std::string s_empty
Definition defs.hpp:78
Class contains common OKS classes and methods.
Definition defs.hpp:46
static std::ostream & warning_msg(const std::string &s)
Definition defs.hpp:53
static std::ostream & error_msg(const std::string &s)
Definition defs.hpp:52
static void substitute_variables(std::string &)
Definition kernel.cpp:575
static std::ostream & warning_msg(const char *)
Definition kernel.cpp:568
static bool real_path(std::string &, bool ignore_errors)
Definition kernel.cpp:599
static std::ostream & error_msg(const char *)
Definition kernel.cpp:561
const std::string strerror(int error)
Convert C error number to string.
Definition kernel.cpp:119
Including Qt Headers.
Definition module.cpp:16
CIB Buffer std::string descriptor Message from std::string descriptor CIB process error