CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
KeyList.cc
Go to the documentation of this file.
3 
4 
5 
6 namespace cond {
7 
8  KeyList::KeyList(IOVKeysDescription const * idescr) : m_description(idescr){}
9 
10  void KeyList::load(std::vector<unsigned long long> const & keys) {
11  m_sequence.db().transaction().start(true);
12  m_data.resize(keys.size());
13  for (size_t i=0; i<keys.size(); ++i) {
14  m_data[i].reset();
15  if (keys[i]!=0) {
17  if (p!=m_sequence.iov().iovs().end()) {
18  m_data[i] = m_sequence.db().getTypedObject<Base>( (*p).token() );
19  }
20  }
21  }
23  }
24 
25 
26  BaseKeyed const * KeyList::elem(int n) const {
27  if (!m_data[n]) return 0;
28  return m_data[n].get();
29  }
30 
31 
32 }
int i
Definition: DBlmapReader.cc:9
void load(std::vector< unsigned long long > const &keys)
Definition: KeyList.cc:10
DbTransaction & transaction()
Definition: DbSession.cc:189
DbSession & db() const
Definition: IOVProxy.cc:311
int commit()
commit transaction.
Container const & iovs() const
Definition: IOVSequence.cc:76
std::vector< boost::shared_ptr< Base > > m_data
Definition: KeyList.h:68
KeyList(IOVKeysDescription const *idescr=0)
Definition: KeyList.cc:8
Container::const_iterator const_iterator
Definition: IOVSequence.h:28
int start(bool readOnly=false)
start transaction
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
cond::IOVProxy m_sequence
Definition: KeyList.h:66
const_iterator findSince(cond::Time_t time) const
Definition: IOVSequence.cc:122
BaseKeyed const * elem(int n) const
Definition: KeyList.cc:26
boost::shared_ptr< T > getTypedObject(const std::string &objectId)
Definition: DbSession.h:125