CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

cond::IOVSequence Class Reference

#include <IOVSequence.h>

Inheritance diagram for cond::IOVSequence:
cond::UpdateStamp

List of all members.

Public Types

typedef Container::const_iterator const_iterator
typedef ora::PVector< ItemContainer
typedef cond::IOVElement Item
typedef Container::iterator iterator

Public Member Functions

size_t add (cond::Time_t time, std::string const &wrapperToken)
bool exist (cond::Time_t time) const
const_iterator find (cond::Time_t time) const
const_iterator findSince (cond::Time_t time) const
cond::Time_t firstSince () const
Container const & iovs () const
 IOVSequence (cond::TimeType ttype)
 IOVSequence (IOVSequence const &rh)
 IOVSequence ()
 IOVSequence (int type, cond::Time_t till, std::string const &imetadata)
cond::Time_t lastTill () const
void loadAll () const
std::string const & metadataToken () const
bool notOrdered () const
IOVSequenceoperator= (IOVSequence const &rh)
Container const & piovs () const
Containerpiovs ()
cond::TimeType timeType () const
size_t truncate ()
void updateLastTill (cond::Time_t till)
 ~IOVSequence ()

Private Member Functions

void disorder ()
Container const & sortMe () const

Private Attributes

Container m_iovs
cond::Time_t m_lastTill
std::string m_metadata
bool m_notOrdered
Containerm_sorted
int m_timetype

Detailed Description

a time order sequence of interval-of-validity The time associated to each interval is the end-validity (till time) the end of each interval is the begin of the next it is a UpdateStamp by mixin (I'll regret..)

Definition at line 22 of file IOVSequence.h.


Member Typedef Documentation

Definition at line 27 of file IOVSequence.h.

Definition at line 25 of file IOVSequence.h.

Definition at line 24 of file IOVSequence.h.

Definition at line 26 of file IOVSequence.h.


Constructor & Destructor Documentation

cond::IOVSequence::IOVSequence ( )

Definition at line 10 of file IOVSequence.cc.

: m_notOrdered(false), m_sorted(0) {}
cond::IOVSequence::IOVSequence ( cond::TimeType  ttype) [explicit]

Definition at line 12 of file IOVSequence.cc.

                                             :
    m_timetype(ttype), m_lastTill(timeTypeSpecs[ttype].endValue),
    m_notOrdered(false), m_metadata(" "),  m_sorted(0) {}
cond::IOVSequence::IOVSequence ( int  type,
cond::Time_t  till,
std::string const &  imetadata 
)

Definition at line 18 of file IOVSequence.cc.

                                                       :
    m_timetype(type), m_lastTill(till),m_notOrdered(false),
    m_metadata(imetadata),  m_sorted(0) {}
cond::IOVSequence::~IOVSequence ( )

Definition at line 23 of file IOVSequence.cc.

References m_sorted.

                           {
    delete m_sorted;
  }
cond::IOVSequence::IOVSequence ( IOVSequence const &  rh)

Definition at line 27 of file IOVSequence.cc.

                                                 : 
    UpdateStamp(rh),
    m_iovs(rh.m_iovs),  
    m_timetype(rh.m_timetype),
    m_lastTill(rh.m_lastTill),
    m_notOrdered(rh.m_notOrdered),
    m_metadata(rh.m_metadata),
    m_sorted(0) {}

Member Function Documentation

size_t cond::IOVSequence::add ( cond::Time_t  time,
std::string const &  wrapperToken 
)
void cond::IOVSequence::disorder ( ) [private]

Definition at line 107 of file IOVSequence.cc.

References m_notOrdered, and m_sorted.

Referenced by add(), and truncate().

                              {
    m_notOrdered=true;
    delete m_sorted; m_sorted=0;
  }
bool cond::IOVSequence::exist ( cond::Time_t  time) const

Definition at line 102 of file IOVSequence.cc.

References ora::PVector< Tp >::end(), findSince(), and iovs().

                                               {
    return findSince(time)!=iovs().end();
  }
IOVSequence::const_iterator cond::IOVSequence::find ( cond::Time_t  time) const

Definition at line 85 of file IOVSequence.cc.

References begin, ora::PVector< Tp >::end(), end, iovs(), lastTill(), L1TEmulatorMonitor_cff::p, and cond::IOVElement::sinceTime().

Referenced by cond::IOVService::exportIOVRangeWithPayload(), findSince(), cond::IOVService::payloadToken(), and cond::IOVService::validity().

                                                                   {
    if (time>lastTill()) return iovs().end();
    IOVSequence::const_iterator p = std::upper_bound(iovs().begin(),iovs().end(),Item(time),
                            boost::bind(std::less<cond::Time_t>(),
                                        boost::bind(&Item::sinceTime,_1),
                                        boost::bind(&Item::sinceTime,_2)
                                        )
                            );
    return (p!=iovs().begin()) ? p-1 : iovs().end(); 
  }
IOVSequence::const_iterator cond::IOVSequence::findSince ( cond::Time_t  time) const

Definition at line 97 of file IOVSequence.cc.

References ora::PVector< Tp >::end(), end, find(), iovs(), L1TEmulatorMonitor_cff::p, and cond::rpcobgas::time.

Referenced by exist().

                                                                        {
    IOVSequence::const_iterator p = find(time);
    return (p!=iovs().end() && (*p).sinceTime()==time) ? p : iovs().end();
  }
cond::Time_t cond::IOVSequence::firstSince ( ) const [inline]
IOVSequence::Container const & cond::IOVSequence::iovs ( ) const
cond::Time_t cond::IOVSequence::lastTill ( ) const [inline]
void cond::IOVSequence::loadAll ( ) const

Definition at line 48 of file IOVSequence.cc.

                                  {
    // m_provenance.get();
    // m_description.get();
    // m_userMetadata.get();
  }
std::string const& cond::IOVSequence::metadataToken ( ) const [inline]
bool cond::IOVSequence::notOrdered ( ) const [inline]

Definition at line 72 of file IOVSequence.h.

References m_notOrdered.

{ return m_notOrdered;}
IOVSequence & cond::IOVSequence::operator= ( IOVSequence const &  rh)

Definition at line 36 of file IOVSequence.cc.

References m_iovs, m_lastTill, m_metadata, m_notOrdered, m_sorted, and m_timetype.

                                                             {
    delete m_sorted;  m_sorted=0;

    m_iovs = rh.m_iovs;  
    m_timetype = rh.m_timetype;
    m_lastTill=rh.m_lastTill;
    m_notOrdered=rh.m_notOrdered;
    m_metadata = rh.m_metadata;
    return *this;
  }
Container const& cond::IOVSequence::piovs ( ) const [inline]

Definition at line 88 of file IOVSequence.h.

References m_iovs.

{ return m_iovs;}
Container& cond::IOVSequence::piovs ( ) [inline]

Definition at line 87 of file IOVSequence.h.

References m_iovs.

Referenced by add(), and truncate().

{ return m_iovs;}
IOVSequence::Container const & cond::IOVSequence::sortMe ( ) const [private]

Definition at line 60 of file IOVSequence.cc.

References ora::PVector< Tp >::begin(), ora::PVector< Tp >::end(), m_iovs, m_sorted, cond::IOVElement::sinceTime(), and python::multivaluedict::sort().

Referenced by iovs().

                                                         {
    delete m_sorted; // shall not be necessary;
    Container * local = new Container(m_iovs);
    std::sort(local->begin(), local->end(), boost::bind(std::less<cond::Time_t>(),
                                                        boost::bind(&Item::sinceTime,_1),
                                                        boost::bind(&Item::sinceTime,_2)
                                                        ) );
    m_sorted = local;
    return *m_sorted;
  }
cond::TimeType cond::IOVSequence::timeType ( ) const [inline]
size_t cond::IOVSequence::truncate ( )
void cond::IOVSequence::updateLastTill ( cond::Time_t  till) [inline]

Definition at line 65 of file IOVSequence.h.

References m_lastTill.

{ m_lastTill=till;}

Member Data Documentation

Definition at line 100 of file IOVSequence.h.

Referenced by iovs(), operator=(), piovs(), and sortMe().

Definition at line 102 of file IOVSequence.h.

Referenced by lastTill(), operator=(), and updateLastTill().

std::string cond::IOVSequence::m_metadata [private]

Definition at line 106 of file IOVSequence.h.

Referenced by metadataToken(), and operator=().

Definition at line 104 of file IOVSequence.h.

Referenced by add(), disorder(), iovs(), notOrdered(), operator=(), and truncate().

Definition at line 117 of file IOVSequence.h.

Referenced by disorder(), iovs(), operator=(), sortMe(), and ~IOVSequence().

Definition at line 101 of file IOVSequence.h.

Referenced by operator=(), and timeType().