Project
Loading...
Searching...
No Matches
QualityControlFlag.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_QUALITYCONTROL_QCFLAG_H
13#define O2_QUALITYCONTROL_QCFLAG_H
14
19
20// System includes
21#include <iosfwd>
22#include <string>
23
24// ROOT includes
25#include <Rtypes.h>
26
28
30#include "DataFormatsQualityControl/FlagTypeFactory.h"
31
32namespace o2
33{
34namespace quality_control
35{
36
40{
41 public:
42 using time_type = uint64_t;
44
45 QualityControlFlag() = default;
47 QualityControlFlag(time_type start, time_type end, FlagType flag, std::string comment = "", std::string source = "Unknown");
48
49 time_type getStart() const { return mInterval.getMin(); }
50 time_type getEnd() const { return mInterval.getMax(); }
51 RangeInterval& getInterval() { return mInterval; }
52 const RangeInterval getInterval() const { return mInterval; }
53 FlagType getFlag() const { return mFlag; }
54 const std::string& getComment() const { return mComment; }
55 const std::string& getSource() const { return mSource; }
56
57 void setStart(time_type start) { mInterval.setMin(start); }
58 void setEnd(time_type end) { mInterval.setMax(end); }
59 void setInterval(RangeInterval interval) { mInterval = interval; }
60 void setFlag(FlagType flag) { mFlag = flag; }
61 void setComment(const std::string& comment) { mComment = comment; }
62 void setSource(const std::string& source) { mSource = source; }
63
65 bool operator==(const QualityControlFlag& rhs) const;
66
68 bool operator<(const QualityControlFlag& rhs) const;
69 bool operator>(const QualityControlFlag& rhs) const;
70
72 void streamTo(std::ostream& output) const;
73
75 friend std::ostream& operator<<(std::ostream& output, const QualityControlFlag& data);
76
77 private:
78 RangeInterval mInterval = {};
79 FlagType mFlag;
80 std::string mComment = "";
81 std::string mSource = "Unknown";
82
83 ClassDefNV(QualityControlFlag, 1);
84};
85
86} // namespace quality_control
87} // namespace o2
88#endif // O2_QUALITYCONTROL_QCFLAG_H
Class to represent an interval and some operations over it.
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
void setMax(T v) noexcept
Definition Bracket.h:132
void setMin(T v) noexcept
Definition Bracket.h:138
bool operator>(const QualityControlFlag &rhs) const
void setComment(const std::string &comment)
void setSource(const std::string &source)
QualityControlFlag(QualityControlFlag const &)=default
void setInterval(RangeInterval interval)
o2::math_utils::detail::Bracket< time_type > RangeInterval
friend std::ostream & operator<<(std::ostream &output, const QualityControlFlag &data)
overloading output stream operator
bool operator<(const QualityControlFlag &rhs) const
comparison operators
void streamTo(std::ostream &output) const
write data to ostream
const RangeInterval getInterval() const
bool operator==(const QualityControlFlag &rhs) const
equal operator
GLuint GLuint end
Definition glcorearb.h:469
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLboolean * data
Definition glcorearb.h:298
GLuint start
Definition glcorearb.h:469
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...