14 #ifndef IOVDATA_SNAPSHOT_H 15 #define IOVDATA_SNAPSHOT_H 50 const std::vector<T>&
Data()
const {
return fData; }
53 template <
class U = T,
59 if (it ==
fData.end() || it->Channel() != ch) {
return false; }
64 template <
class U = T,
65 typename std::enable_if<std::is_base_of<ChData, U>::value,
int>::type = 0>
66 const T&
GetRow(
unsigned int ch)
const 71 if (it ==
fData.end() || it->Channel() != ch) {
72 std::string msg(
"Channel not found: ");
80 template <
class U = T,
81 typename std::enable_if<std::is_base_of<ChData, U>::value,
int>::type = 0>
85 std::lower_bound(
fData.begin(),
fData.end(), data.Channel());
86 if (it ==
fData.end() || data.Channel() != it->Channel()) {
87 bool sort = (!(
fData.empty()) && data <
fData.back());
88 fData.push_back(data);
89 if (sort) std::sort(
fData.begin(),
fData.end());
117 throw IOVDataError(
"Called Snapshot::SetIoV with start timestamp >= end timestamp!");
void SetStamp(unsigned long stamp, unsigned int substamp=0)
~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.
unsigned long SubStamp() const
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
Snapshot()
Default constructor.
const IOVTimeStamp & Start() const
Filters for channels, events, etc.
void SetIoV(const IOVTimeStamp &start, const IOVTimeStamp &end)
const IOVTimeStamp & End() const
unsigned long Stamp() const
const std::vector< T > & Data() const
Collection of exception classes for IOVData.
Class def header for a class ChData.
static IOVTimeStamp MaxTimeStamp()
bool IsValid(const IOVTimeStamp &ts) const