14 #ifndef IOVDATA_SNAPSHOT_H
15 #define IOVDATA_SNAPSHOT_H
57 template<
class U = T,
61 typename std::vector<T>::const_iterator it = std::lower_bound(
fData.begin(),
fData.end(), ch);
62 if ( it ==
fData.end() || it->Channel() != ch) {
68 template<
class U = T,
70 const T&
GetRow(
unsigned int ch)
const {
72 typename std::vector<T>::const_iterator it = std::lower_bound(
fData.begin(),
fData.end(), ch);
74 if ( it ==
fData.end() || it->Channel() != ch ) {
75 std::string
msg(
"Channel not found: ");
83 template<
class U = T,
86 typename std::vector<T>::iterator it = std::lower_bound(
fData.begin(),
fData.end(), data.Channel());
87 if (it ==
fData.end() || data.Channel() != it->Channel() ) {
88 bool sort = ( !(
fData.empty()) && data <
fData.back());
89 fData.push_back(data);
90 if (sort) std::sort(
fData.begin(),
fData.end());
111 fStart.SetStamp(fStart.Stamp()-1, fStart.SubStamp());
117 throw IOVDataError(
"Called Snapshot::SetIoV with start timestamp >= end timestamp!");
126 return (ts >= fStart && ts < fEnd);
~Snapshot()
Default destructor.
void AddOrReplaceRow(const T &data)
bool HasChannel(unsigned int ch) const
Only included with class if T has base class ChData.
const T & GetRow(unsigned int ch) const
Class def header for a class IOVTimeStamp.
auto end(FixedBins< T, C > const &) noexcept
Snapshot()
Default constructor.
const IOVTimeStamp & Start() const
void SetIoV(const IOVTimeStamp &start, const IOVTimeStamp &end)
const IOVTimeStamp & End() const
const std::vector< T > & Data() const
std::string to_string(WindowPattern const &pattern)
Collection of exception classes for IOVData.
Class def header for a class ChData.
static IOVTimeStamp MaxTimeStamp()
bool IsValid(const IOVTimeStamp &ts) const