CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

cond::KeyList Class Reference

#include <KeyList.h>

List of all members.

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 (char const *iname) const
template<typename T >
T const * get (std::string const &iname) const
template<typename T >
T const * get (int n) 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.

: m_description(idescr){}

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

                                             {
    if (!m_data[n]) return 0;
    return m_data[n].get();
  }
BaseKeyed const* cond::KeyList::elem ( std::string const &  iname) const
BaseKeyed const* cond::KeyList::elem ( char const *  iname) const
template<typename T >
T const* cond::KeyList::get ( char const *  iname) const [inline]

Definition at line 44 of file KeyList.h.

References elem().

                                            {
      return dynamic_cast<T const *>(elem(iname));
    }
template<typename T >
T const* cond::KeyList::get ( std::string const &  iname) const [inline]

Definition at line 49 of file KeyList.h.

References elem().

                                                 {
      return dynamic_cast<T const *>(elem(iname));
    }
template<typename T >
T const* cond::KeyList::get ( int  n) const [inline]
void cond::KeyList::init ( cond::IOVProxy const &  seq) [inline]

Definition at line 32 of file KeyList.h.

References m_sequence.

                                         {
      m_sequence = seq;
    }
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().

                                                               {
    m_sequence.db().transaction().start(true);
    m_data.resize(keys.size());
    for (size_t i=0; i<keys.size(); ++i) {
      m_data[i].reset();
      if (keys[i]!=0) {
        IOVSequence::const_iterator p = m_sequence.iov().findSince(keys[i]);
        if (p!=m_sequence.iov().iovs().end()) { 
          m_data[i] = m_sequence.db().getTypedObject<Base>( (*p).wrapperToken() );
        }
      }
    }
    m_sequence.db().transaction().commit();
  }
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().

{ return m_data.size();}

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

Definition at line 63 of file KeyList.h.

Definition at line 66 of file KeyList.h.

Referenced by init(), and load().