CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
cond::KeyList Class Reference

#include <KeyList.h>

Public Types

typedef BaseKeyed Base
 

Public Member Functions

BaseKeyed const * elem (int n) const
 
BaseKeyed const * elem (char const *iname) const
 
BaseKeyed const * elem (std::string const &iname) const
 
template<typename T >
T const * get (int n) const
 
template<typename T >
T const * get (char const *iname) const
 
template<typename T >
T const * get (std::string const &iname) const
 
void init (cond::IOVProxy const &seq)
 
 KeyList (IOVKeysDescription const *idescr=0)
 
void load (std::vector< unsigned long long > const &keys)
 
int size () const
 

Private Attributes

std::vector< boost::shared_ptr
< Base > > 
m_data
 
IOVKeysDescription const * m_description
 
cond::IOVProxy m_sequence
 

Detailed Description

Definition at line 26 of file KeyList.h.

Member Typedef Documentation

Definition at line 28 of file KeyList.h.

Constructor & Destructor Documentation

cond::KeyList::KeyList ( IOVKeysDescription const *  idescr = 0)

Definition at line 8 of file KeyList.cc.

8 : m_description(idescr){}
IOVKeysDescription const * m_description
Definition: KeyList.h:63

Member Function Documentation

BaseKeyed const * cond::KeyList::elem ( int  n) const

Definition at line 26 of file KeyList.cc.

References m_data, and n.

Referenced by get().

26  {
27  if (!m_data[n]) return 0;
28  return m_data[n].get();
29  }
std::vector< boost::shared_ptr< Base > > m_data
Definition: KeyList.h:68
BaseKeyed const* cond::KeyList::elem ( char const *  iname) const
BaseKeyed const* cond::KeyList::elem ( std::string const &  iname) const
template<typename T >
T const* cond::KeyList::get ( int  n) const
inline
template<typename T >
T const* cond::KeyList::get ( char const *  iname) const
inline
template<typename T >
T const* cond::KeyList::get ( std::string const &  iname) const
inline
void cond::KeyList::init ( cond::IOVProxy const &  seq)
inline

Definition at line 32 of file KeyList.h.

References m_sequence.

32  {
33  m_sequence = seq;
34  }
cond::IOVProxy m_sequence
Definition: KeyList.h:66
void cond::KeyList::load ( std::vector< unsigned long long > const &  keys)

Definition at line 10 of file KeyList.cc.

References cond::DbTransaction::commit(), cond::IOVProxy::db(), ora::QueryableVector< Tp >::end(), cond::IOVSequence::findSince(), cond::DbSession::getTypedObject(), i, cond::IOVProxy::iov(), cond::IOVSequence::iovs(), m_data, m_sequence, AlCaHLTBitMon_ParallelJobs::p, cond::DbTransaction::start(), and cond::DbSession::transaction().

Referenced by MatrixToProcess.MatrixToProcess::getProcess(), and MatrixToProcess.MatrixToProcess::listAll().

10  {
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  }
int i
Definition: DBlmapReader.cc:9
IOVSequence const & iov() const
Definition: IOVProxy.cc:276
DbTransaction & transaction()
Definition: DbSession.cc:208
int commit()
commit transaction.
Container const & iovs() const
Definition: IOVSequence.cc:76
std::vector< boost::shared_ptr< Base > > m_data
Definition: KeyList.h:68
Container::const_iterator const_iterator
Definition: IOVSequence.h:29
int start(bool readOnly=false)
start transaction
cond::IOVProxy m_sequence
Definition: KeyList.h:66
const_iterator findSince(cond::Time_t time) const
Definition: IOVSequence.cc:122
boost::shared_ptr< T > getTypedObject(const std::string &objectId)
Definition: DbSession.h:126
BaseKeyed Base
Definition: KeyList.h:28
DbSession & db()
Definition: IOVProxy.cc:312
int cond::KeyList::size ( void  ) const
inline

Definition at line 59 of file KeyList.h.

References m_data.

59 { return m_data.size();}
std::vector< boost::shared_ptr< Base > > m_data
Definition: KeyList.h:68

Member Data Documentation

std::vector<boost::shared_ptr<Base> > cond::KeyList::m_data
private

Definition at line 68 of file KeyList.h.

Referenced by elem(), load(), and size().

IOVKeysDescription const* cond::KeyList::m_description
private

Definition at line 63 of file KeyList.h.

cond::IOVProxy cond::KeyList::m_sequence
private

Definition at line 66 of file KeyList.h.

Referenced by init(), and load().