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::QueryableVector
< Item
Container
typedef cond::IOVElement Item
typedef Container::iterator iterator
enum  ScopeType {
  Unknown = -1, Obsolete, Tag, TagInGT,
  ChildTag, ChildTagInGT
}

Public Member Functions

size_t add (cond::Time_t time, std::string const &token, std::string const &payloadClassName)
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 & metadata () const
bool notOrdered () const
IOVSequenceoperator= (IOVSequence const &rh)
std::set< std::string > const & payloadClasses () const
Container const & piovs () const
Containerpiovs ()
ScopeType scope () const
void setScope (ScopeType type)
void swapOIds (ora::ITokenWriter &writer) const
void swapTokens (ora::ITokenParser &parser) const
cond::TimeType timeType () const
size_t truncate ()
void updateLastTill (cond::Time_t till)
void updateMetadata (const std::string &metadata, bool append=true)
 ~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
std::set< std::string > m_payloadClasses
ScopeType m_scope
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 23 of file IOVSequence.h.


Member Typedef Documentation

Definition at line 28 of file IOVSequence.h.

Definition at line 26 of file IOVSequence.h.

Definition at line 25 of file IOVSequence.h.

Definition at line 27 of file IOVSequence.h.


Member Enumeration Documentation

Enumerator:
Unknown 
Obsolete 
Tag 
TagInGT 
ChildTag 
ChildTagInGT 

Definition at line 29 of file IOVSequence.h.


Constructor & Destructor Documentation

cond::IOVSequence::IOVSequence ( )

Definition at line 8 of file IOVSequence.cc.

cond::IOVSequence::IOVSequence ( cond::TimeType  ttype) [explicit]

Definition at line 18 of file IOVSequence.cc.

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

Definition at line 28 of file IOVSequence.cc.

                                                       :
    m_iovs(),
    m_timetype(ttype),
    m_lastTill(till),
    m_notOrdered(false), 
    m_metadata(imetadata),
    m_payloadClasses(),
    m_scope( Unknown ),
    m_sorted(0) {}
cond::IOVSequence::~IOVSequence ( )

Definition at line 40 of file IOVSequence.cc.

References m_sorted.

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

Definition at line 44 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_payloadClasses(rh.m_payloadClasses),
    m_scope( rh.m_scope ),
    m_sorted(0) {}

Member Function Documentation

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

Definition at line 142 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 127 of file IOVSequence.cc.

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

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

Definition at line 110 of file IOVSequence.cc.

References begin, ora::QueryableVector< Tp >::end(), end, iovs(), lastTill(), AlCaHLTBitMon_ParallelJobs::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 122 of file IOVSequence.cc.

References ora::QueryableVector< Tp >::end(), end, find(), iovs(), AlCaHLTBitMon_ParallelJobs::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 69 of file IOVSequence.cc.

References ora::QueryableVector< Tp >::load(), and m_iovs.

Referenced by cond::loadIOV().

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

Definition at line 76 of file IOVSequence.h.

References m_notOrdered.

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

Definition at line 55 of file IOVSequence.cc.

References m_iovs, m_lastTill, m_metadata, m_notOrdered, m_payloadClasses, m_scope, 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;
    m_payloadClasses = rh.m_payloadClasses;
    m_scope = rh.m_scope;
    return *this;
  }
std::set<std::string> const& cond::IOVSequence::payloadClasses ( ) const [inline]

Definition at line 80 of file IOVSequence.h.

References m_payloadClasses.

Referenced by cond::IOVService::payloadClasses().

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

Definition at line 89 of file IOVSequence.h.

References ora::QueryableVector< Tp >::load(), and m_iovs.

Referenced by add(), and truncate().

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

Definition at line 93 of file IOVSequence.h.

References ora::QueryableVector< Tp >::load(), and m_iovs.

                                    { 
      m_iovs.load();
      return m_iovs;
    }
ScopeType cond::IOVSequence::scope ( ) const [inline]

Definition at line 82 of file IOVSequence.h.

References m_scope.

{ return m_scope;}
void cond::IOVSequence::setScope ( ScopeType  type) [inline]

Definition at line 70 of file IOVSequence.h.

References m_scope.

{ m_scope = type;}
IOVSequence::Container const & cond::IOVSequence::sortMe ( ) const [private]

Definition at line 82 of file IOVSequence.cc.

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

Referenced by iovs().

                                                         {
    m_iovs.load();
    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;
  }
void cond::IOVSequence::swapOIds ( ora::ITokenWriter writer) const

Definition at line 157 of file IOVSequence.cc.

References ora::QueryableVector< Tp >::begin(), ora::QueryableVector< Tp >::end(), and m_iovs.

                                                            {
    for( IOVSequence::const_iterator iT = m_iovs.begin();
         iT != m_iovs.end(); ++iT ){
      iT->swapOId( writer );
    }
  }
void cond::IOVSequence::swapTokens ( ora::ITokenParser parser) const

Definition at line 147 of file IOVSequence.cc.

References ora::QueryableVector< Tp >::begin(), cond::className(), ora::ITokenParser::className(), ora::QueryableVector< Tp >::end(), m_iovs, and m_payloadClasses.

                                                              {
    for( IOVSequence::const_iterator iT = m_iovs.begin();
         iT != m_iovs.end(); ++iT ){
      iT->swapToken( parser );
      // adding the classname 'by hand'
      std::string className = parser.className( iT->token() );
      const_cast<IOVSequence* >(this)->m_payloadClasses.insert( className );
    }
  }
cond::TimeType cond::IOVSequence::timeType ( ) const [inline]
size_t cond::IOVSequence::truncate ( )
void cond::IOVSequence::updateLastTill ( cond::Time_t  till) [inline]

Definition at line 66 of file IOVSequence.h.

References m_lastTill.

{ m_lastTill=till;}
void cond::IOVSequence::updateMetadata ( const std::string &  metadata,
bool  append = true 
)

Definition at line 131 of file IOVSequence.cc.

References m_metadata, and metadata().

                                                 {
    std::string sep(". ");
    if( !metadata.empty() ){
      if (append && !m_metadata.empty()) {
        m_metadata += sep + metadata;
      }
      else m_metadata = metadata;
    }
  }

Member Data Documentation

Definition at line 111 of file IOVSequence.h.

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

Definition at line 113 of file IOVSequence.h.

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

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

Definition at line 115 of file IOVSequence.h.

Referenced by metadata(), operator=(), and updateMetadata().

Definition at line 114 of file IOVSequence.h.

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

std::set<std::string> cond::IOVSequence::m_payloadClasses [private]

Definition at line 116 of file IOVSequence.h.

Referenced by add(), operator=(), payloadClasses(), and swapTokens().

Definition at line 117 of file IOVSequence.h.

Referenced by operator=(), scope(), and setScope().

Definition at line 119 of file IOVSequence.h.

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

Definition at line 112 of file IOVSequence.h.

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