18#ifndef DBDATAOBJECTS_CONDATTRLISTVEC_H
19#define DBDATAOBJECTS_CONDATTRLISTVEC_H
22#include "CoralBase/Attribute.h"
23#include "CoralBase/AttributeList.h"
24#include "CoralBase/AttributeListSpecification.h"
28#include "GaudiKernel/DataObject.h"
41 typedef std::map<unsigned int, std::vector<const coral::AttributeList*> >
82 void add(
const IOVRange& range,
const unsigned int chan,
88 const std::vector<coral::AttributeList>&
data,
89 const unsigned int datastart,
const unsigned int dataend);
95 const std::vector<unsigned int>&
channelIDs()
const;
103 const std::vector<const coral::AttributeList*>&
115 coral::AttributeListSpecification*
m_spec;
124#include "AthenaKernel/CondCont.h"
150 DataObject::DataObject(rhs),
159 if (!rhs.
m_data.empty()) {
160 m_spec=new coral::AttributeListSpecification();
161 const coral::AttributeList& atr1=rhs.m_data.begin()->second;
162 for (const auto& attr : atr1) {
163 const coral::AttributeSpecification& aspec=attr.specification();
164 m_spec->extend(aspec.name(),aspec.typeName());
166 for (
const auto& [chan, attrList] : rhs.
m_data) {
167 m_data.push_back(AttrListPair(chan,
168 coral::AttributeList(*m_spec,true)));
169 (m_data.back().second).fastCopyData(attrList);
239 const unsigned int chan,
245 if (
m_minrange.start()<range.start()) start=range.start();
247 if (range.stop()<
m_minrange.stop()) stop=range.stop();
251 if (!
m_spec && data_begin!=data_end) {
252 m_spec=
new coral::AttributeListSpecification();
253 for (
const auto& attr : *data_begin) {
254 const coral::AttributeSpecification& aspec=attr.specification();
255 m_spec->extend(aspec.name(),aspec.typeName());
261 (
m_data.back().second).fastCopyData(*itr);
268 const unsigned int chan,
269 const std::vector<coral::AttributeList>&
data,
270 const unsigned int datastart,
const unsigned int dataend)
276 if (
m_minrange.start()<range.start()) start=range.start();
278 if (range.stop()<
m_minrange.stop()) stop=range.stop();
282 if (!
m_spec && datastart!=dataend) {
283 m_spec=
new coral::AttributeListSpecification();
284 const coral::AttributeList& atr0=
data[datastart];
285 for (
const auto& attr : atr0) {
286 const coral::AttributeSpecification& aspec=attr.specification();
287 m_spec->extend(aspec.name(),aspec.typeName());
291 for (
unsigned int i=datastart;i<dataend;++i) {
308 return (m.find(chan)!=m.end());
311inline const std::vector<const coral::AttributeList*>&
315 AttrListCVMap::const_iterator it = m.find (chan);
319 static const std::vector<const coral::AttributeList*> dum;
332 unsigned int chan=p.first;
333 AttrListCVMap::iterator clist=
index.m_indexchanvec.find(chan);
334 if (clist==
index.m_indexchanvec.end()) {
336 std::pair<AttrListCVMap::iterator,bool>
res=
337 index.m_indexchanvec.insert(AttrListCVMap::value_type(chan,
338 std::vector<const coral::AttributeList*>()));
340 index.m_indexchan.push_back(chan);
342 clist->second.push_back(&(p.second));
Cached value with atomic update.
#define CONDCONT_DEF(...)
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
char data[hepevt_bytes_allocation_ATLAS]
std::pair< std::vector< unsigned int >, bool > res
std::vector< coral::AttributeList >::const_iterator AttrListDataIter
iov_const_iterator iov_begin() const
CxxUtils::CachedValue< Index > m_index
bool hasUniqueIOV() const
AttrListVec::const_iterator const_iterator
void addSlice(const IOVRange &range, const unsigned int chan, const std::vector< coral::AttributeList > &data, const unsigned int datastart, const unsigned int dataend)
AttrListIOVMap::size_type iov_size_type
const_iterator end() const
const_iterator begin() const
AttrListIOVMap::const_iterator iov_const_iterator
std::map< unsigned int, std::vector< const coral::AttributeList * > > AttrListCVMap
void addNewStop(const IOVTime &stop)
const Index & index() const
std::map< unsigned int, IOVRange > AttrListIOVMap
coral::AttributeListSpecification * m_spec
AttrListVec::size_type size_type
CondAttrListVec & operator=(const CondAttrListVec &rhs)=delete
iov_const_iterator iovRange(const unsigned int channel) const
const std::vector< unsigned int > & channelIDs() const
std::vector< AttrListPair > AttrListVec
std::pair< unsigned int, coral::AttributeList > AttrListPair
const std::vector< const coral::AttributeList * > & attrListVec(const int chan) const
size_type iov_size() const
bool hasChannel(const int chan) const
CondAttrListVec(bool runevent)
iov_const_iterator iov_end() const
const IOVRange & minRange() const
void add(const IOVRange &range, const unsigned int chan, AttrListDataIter data_begin, AttrListDataIter data_end)
Cached value with atomic update.
Basic time unit for IOVSvc.
static constexpr uint64_t MAXTIMESTAMP
static constexpr uint64_t MINTIMESTAMP
AttrListCVMap m_indexchanvec
std::vector< unsigned int > m_indexchan