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 DTUserKeyedConfigPopConAnalyzer::analyze(), DTKeyedConfigPopConAnalyzer::analyze(), and 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

Definition at line 44 of file KeyList.h.

References elem().

Referenced by Options.Options::__getitem__().

44  {
45  return dynamic_cast<T const *>(elem(iname));
46  }
BaseKeyed const * elem(int n) const
Definition: KeyList.cc:26
template<typename T >
T const* cond::KeyList::get ( std::string const &  iname) const
inline

Definition at line 49 of file KeyList.h.

References elem().

Referenced by Options.Options::__getitem__().

49  {
50  return dynamic_cast<T const *>(elem(iname));
51  }
BaseKeyed const * elem(int n) const
Definition: KeyList.cc:26
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(), cond::DbSession::getTypedObject(), i, cond::IOVProxy::iov(), m_data, m_sequence, L1TEmulatorMonitor_cff::p, cond::DbTransaction::start(), and cond::DbSession::transaction().

Referenced by DTKeyedConfigDBDump::analyze(), DTUserKeyedConfigHandler::chkConfigList(), DTKeyedConfigHandler::chkConfigList(), and DTConfigPluginHandler::get().

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).wrapperToken() );
19  }
20  }
21  }
23  }
int i
Definition: DBlmapReader.cc:9
DbTransaction & transaction()
Definition: DbSession.cc:153
DbSession & db() const
Definition: IOVProxy.cc:156
int commit()
commit transaction.
std::vector< boost::shared_ptr< Base > > m_data
Definition: KeyList.h:68
Container::const_iterator const_iterator
Definition: IOVSequence.h:27
int start(bool readOnly=false)
start transaction
cond::IOVProxy m_sequence
Definition: KeyList.h:66
IOV const & iov() const
Definition: IOVProxy.cc:125
boost::shared_ptr< T > getTypedObject(const std::string &objectId)
Definition: DbSession.h:98
BaseKeyed Base
Definition: KeyList.h:28
int cond::KeyList::size ( void  ) const
inline

Definition at line 59 of file KeyList.h.

References m_data.

Referenced by DTUserKeyedConfigPopConAnalyzer::analyze(), and DTKeyedConfigPopConAnalyzer::analyze().

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().