 |
DD4hep
1.35.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
30 if ( &
copy !=
this ) {
41 ::snprintf(text,
sizeof(text),
"%s(%d)",
name.c_str(),
int(
type));
52 : iovType(t), keyData(iov_value,iov_value)
59 : iovType(t), keyData(k)
70 void IOV::set(Key::first_type value) {
75 void IOV::set(Key::first_type val_1, Key::second_type val_2) {
89 Key::first_type tmp =
keyData.first;
105 if ( validity.first >
keyData.first )
106 keyData.first = validity.first;
107 if ( validity.second <
keyData.second )
108 keyData.second = validity.second;
121 if ( validity.first <
keyData.first )
122 keyData.first = validity.first;
123 if ( validity.second >
keyData.second )
124 keyData.second = validity.second;
142 ::snprintf(text,
sizeof(text),
"%s(%u):[%ld-%ld]",
147 char c_since[64], c_until[64];
149 static const Key_value_type max_time = detail::makeTime(2099,12,31,24,59,59);
150 std::time_t since = std::min(std::max(
keyData.first, nil), max_time);
151 std::time_t until = std::min(std::max(
keyData.second,nil), max_time);
152 struct tm* tm_since = ::gmtime_r(&since,&time_buff);
153 struct tm* tm_until = ::gmtime_r(&until,&time_buff);
154 if (
nullptr == tm_since ||
nullptr == tm_until ) {
155 except(
"IOV::str",
" Invalid epoch time stamp: %d:[%ld-%ld]",
158 ::strftime(c_since,
sizeof(c_since),
"%d-%m-%Y %H:%M:%S", tm_since);
159 ::strftime(c_until,
sizeof(c_until),
"%d-%m-%Y %H:%M:%S", tm_until);
160 ::snprintf(text,
sizeof(text),
"%s(%u):[%s - %s]",
165 ::snprintf(text,
sizeof(text),
"%s(%u):[%ld-%ld]",
170 ::snprintf(text,
sizeof(text),
"%u:[%ld-%ld]",
type,
long(
keyData.first),
long(
keyData.second));
void iov_intersection(const IOV &comparator)
Set the intersection of this IOV with the argument IOV.
bool contains(const IOV &iov) const
Check for validity containment.
std::string name
String name.
int optData
Optional user data.
IOV & invert()
Invert the key values (first=second and second=first)
std::int64_t Key_value_type
Key definition. Use fixed width type, though not portable!
static constexpr unsigned int UNKNOWN_IOV
std::string str() const
Conversion to string.
std::string str() const
Create string representation of the IOV.
std::pair< Key_value_type, Key_value_type > Key
Class describing the interval of validty type.
IOV()=delete
Initializing constructor: Does not set reference to IOVType !
Class describing the interval of validty.
void move(IOV &from)
Move the data content: 'from' will be reset to NULL.
IOVType & operator=(const IOVType ©)=default
Assignment operator.
void set(const Key &value)
Set discrete IOV value.
Key keyData
IOV key (if second==first, discrete, otherwise range)
static bool key_is_contained(const Key &key, const Key &test)
Check if IOV 'test' is fully contained in IOV 'key'.
unsigned int type
IOV buffer type: Must be a bitmap!
void iov_union(const IOV &comparator)
Set the union of this IOV with the argument IOV.
IOV & reset()
Set keys to unphysical values (LONG_MAX, LONG_MIN)
const IOVType * iovType
Reference to IOV type.
Namespace for the AIDA detector description toolkit.
unsigned int type
integer identifier used internally