ATLAS Offline Software
IOVPayloadContainer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef IOVDBDATAMODEL_IOVPAYLOADCONTAINER_H
6 #define IOVDBDATAMODEL_IOVPAYLOADCONTAINER_H
7 
21 #include "AthenaKernel/IOVRange.h"
23 
24 #include <vector>
25 
36 public:
37 
38  typedef std::vector<CondAttrListCollection*> payloadVec;
39  typedef payloadVec::const_iterator const_iterator;
40  typedef payloadVec::size_type size_type;
41 
43 
49 
51 
52 
54  const_iterator begin() const;
55 
57  const_iterator end() const;
58 
60  CondAttrListCollection* at(unsigned int i) const;
61 
63  size_type size() const;
64 
66  //provided IOVTime
67  const_iterator find(const IOVTime& time) const;
68 
70 
72 
73  bool merge(CondAttrListCollection* attrListColl);
80 
81 private:
84 
86  public:
88  { return (x->minRange().start() < y); }
89  };
90 
92  public:
94  { return (x->minRange().stop() < y); }
95  };
96 
98 };
99 
100 // inlines
101 inline
103 {}
104 
105 inline
108 {
109  return (m_payloadVec.begin());
110 }
111 
112 inline
115 {
116  return (m_payloadVec.end());
117 }
118 
119 inline
122 {
123  return (m_payloadVec.size());
124 }
125 
126 inline
128 IOVPayloadContainer::at(unsigned int i) const
129 {
130  if (i < m_payloadVec.size()) return m_payloadVec[i];
131  return (0);
132 }
133 
134 inline
137 {
138  // Find first collection where time < stop time
139  const_iterator result = std::lower_bound(m_payloadVec.begin(),
140  m_payloadVec.end(),
142  // At end return:
143  if ( result == m_payloadVec.end() ) return (result) ;
144 
145  // If time == stop, move forward one
146  if ( (*result)->minRange().stop() == time) ++result;
147 
148  // At end return:
149  if ( result == m_payloadVec.end() ) return (result) ;
150 
151  // Check that time is in interval
152  if ( (*result)->minRange().start() <= time) return (result);
153 
154  // Not found
155  return (m_payloadVec.end());
156 }
157 
158 
159 #endif // IOVDBDATAMODEL_IOVPAYLOADCONTAINER_H
IOVPayloadContainer::at
CondAttrListCollection * at(unsigned int i) const
Element access.
Definition: IOVPayloadContainer.h:128
IOVPayloadContainer::payloadVec
std::vector< CondAttrListCollection * > payloadVec
Definition: IOVPayloadContainer.h:38
get_generator_info.result
result
Definition: get_generator_info.py:21
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
IOVRange.h
Validity Range object. Holds two IOVTime instances (start and stop)
IOVPayloadContainer::AttrListCollSortStop
Definition: IOVPayloadContainer.h:91
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
x
#define x
IOVPayloadContainer::IOVPayloadContainer
IOVPayloadContainer()
Definition: IOVPayloadContainer.h:102
IOVPayloadContainer::size
size_type size() const
size of payload vector
Definition: IOVPayloadContainer.h:121
IOVPayloadContainer::operator=
IOVPayloadContainer & operator=(const IOVPayloadContainer &cont)
Definition: IOVPayloadContainer.cxx:22
IOVPayloadContainer::begin
const_iterator begin() const
Begin of payload vector.
Definition: IOVPayloadContainer.h:107
IOVTime
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
Definition: IOVTime.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
IOVPayloadContainerCnv_p1
Definition: IOVPayloadContainerCnv_p1.h:18
IOVPayloadContainer::size_type
payloadVec::size_type size_type
Definition: IOVPayloadContainer.h:40
IOVPayloadContainer::~IOVPayloadContainer
~IOVPayloadContainer()
Definition: IOVPayloadContainer.cxx:7
IOVPayloadContainer::m_payloadVec
payloadVec m_payloadVec
Definition: IOVPayloadContainer.h:97
IOVPayloadContainer::AttrListCollSortStop::operator()
bool operator()(const CondAttrListCollection *x, const IOVTime &y)
Definition: IOVPayloadContainer.h:93
IOVPayloadContainer
This class is a container for the payload of conditions data. It is intended to be used to store cond...
Definition: IOVPayloadContainer.h:35
IOVPayloadContainer::AttrListCollSortStart
Definition: IOVPayloadContainer.h:85
y
#define y
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
IOVPayloadContainer::const_iterator
payloadVec::const_iterator const_iterator
Definition: IOVPayloadContainer.h:39
IOVPayloadContainer::end
const_iterator end() const
End of payload vector.
Definition: IOVPayloadContainer.h:114
IOVPayloadContainerPTCnv_p1
Definition: IOVPayloadContainerPTCnv_p1.h:22
IOVPayloadContainer::AttrListCollSortStart::operator()
bool operator()(const CondAttrListCollection *x, const IOVTime &y)
Definition: IOVPayloadContainer.h:87
IOVPayloadContainer::find
const_iterator find(const IOVTime &time) const
find the first payload that has a IOVRange which includes the
Definition: IOVPayloadContainer.h:136
IOVPayloadContainer::merge
bool merge(CondAttrListCollection *attrListColl)
Add in new payload, checking that it is not a duplicate.
Definition: IOVPayloadContainer.cxx:36