DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
defs.hpp
Go to the documentation of this file.
1#ifndef OKS_DEFS_H
2#define OKS_DEFS_H
3
4#include <string>
5#include <iosfwd>
6
7#include "ers/ers.hpp"
8
9#include "oks/exceptions.hpp"
10
11
21namespace dunedaq {
22namespace oks
23{
28 const std::string
29 strerror(int error);
30
31
33
41class Oks {
42
43 public:
44
45 static std::ostream& error_msg(const char *);
46 static std::ostream& warning_msg(const char *);
47 static std::ostream& error_msg(const std::string& s) {return error_msg(s.c_str());}
48 static std::ostream& warning_msg(const std::string& s) {return warning_msg(s.c_str());}
49
50 static void substitute_variables(std::string&);
51 static bool real_path(std::string&, bool ignore_errors);
52
53
58 class Tokenizer {
59
60 public:
61
62 Tokenizer(const std::string& s, const char * separator);
63 const std::string next();
64 bool next(std::string&);
65
66
67 private:
68
69 std::string p_string;
70 const char * p_delimeters;
71 std::string::size_type p_idx;
72
73 static std::string s_empty;
74 };
75
76};
77
78
79} // namespace oks
80} // namespace dunedaq
81
82
83 // defines MACRO and CONSTANTS for verbose report
84
85#ifndef ERS_NO_DEBUG
86# include <boost/date_time/posix_time/posix_time_types.hpp>
87# include <boost/date_time/posix_time/time_formatters.hpp>
88# 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();}
89#else
90# define OSK_VERBOSE_REPORT(MSG) ;
91#endif
92
93
94 // defines MACRO for OKS profiler
95
96#ifndef ERS_NO_DEBUG
97# define OSK_PROFILING(FID, K) OksFunctionProfiler yyy(FID, K);
98#else
99# define OSK_PROFILING(FID, K) ;
100#endif
101
102#endif
String tokenizer.
Definition defs.hpp:58
std::string::size_type p_idx
Definition defs.hpp:71
const std::string next()
Definition time.cpp:189
const char * p_delimeters
Definition defs.hpp:70
Tokenizer(const std::string &s, const char *separator)
Definition time.cpp:181
static std::string s_empty
Definition defs.hpp:73
Class contains common OKS classes and methods.
Definition defs.hpp:41
static std::ostream & warning_msg(const std::string &s)
Definition defs.hpp:48
static std::ostream & error_msg(const std::string &s)
Definition defs.hpp:47
static void substitute_variables(std::string &)
Definition kernel.cpp:570
static std::ostream & warning_msg(const char *)
Definition kernel.cpp:563
static bool real_path(std::string &, bool ignore_errors)
Definition kernel.cpp:594
static std::ostream & error_msg(const char *)
Definition kernel.cpp:556
const std::string strerror(int error)
Convert C error number to string.
Definition kernel.cpp:114
Including Qt Headers.
Definition __init__.py:1
Factory couldn t std::string alg_name Invalid configuration error
Definition Issues.hpp:34