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 Member Functions | Private Attributes
cond::IOVSequence Class Reference

#include <IOVSequence.h>

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

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 ()
 
 IOVSequence (cond::TimeType ttype)
 
 IOVSequence (int type, cond::Time_t till, std::string const &imetadata)
 
 IOVSequence (IOVSequence const &rh)
 
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
 
Containerpiovs ()
 
Container const & piovs () const
 
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 ()
 
- Public Member Functions inherited from cond::UpdateStamp
std::string const & comment () const
 
int revision () const
 
int stamp (std::string const &icomment, bool append=false)
 
cond::Time_t timestamp () const
 
 UpdateStamp ()
 
 UpdateStamp (UpdateStamp const &rhs)
 
virtual ~UpdateStamp ()
 

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

Constructor & Destructor Documentation

cond::IOVSequence::IOVSequence ( )

Definition at line 8 of file IOVSequence.cc.

8  :
9  m_iovs(),
10  m_timetype(-1),
11  m_lastTill(0),
12  m_notOrdered(false),
13  m_metadata(""),
15  m_scope( Unknown ),
16  m_sorted(0) {}
std::string m_metadata
Definition: IOVSequence.h:115
Container m_iovs
Definition: IOVSequence.h:111
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:116
ScopeType m_scope
Definition: IOVSequence.h:117
Container * m_sorted
Definition: IOVSequence.h:119
cond::Time_t m_lastTill
Definition: IOVSequence.h:113
cond::IOVSequence::IOVSequence ( cond::TimeType  ttype)
explicit

Definition at line 18 of file IOVSequence.cc.

18  :
19  m_iovs(),
20  m_timetype(ttype),
21  m_lastTill(timeTypeSpecs[ttype].endValue),
22  m_notOrdered(false),
23  m_metadata(" "),
25  m_scope( Unknown ),
26  m_sorted(0) {}
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
std::string m_metadata
Definition: IOVSequence.h:115
Container m_iovs
Definition: IOVSequence.h:111
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:116
ScopeType m_scope
Definition: IOVSequence.h:117
Container * m_sorted
Definition: IOVSequence.h:119
cond::Time_t m_lastTill
Definition: IOVSequence.h:113
cond::IOVSequence::IOVSequence ( int  type,
cond::Time_t  till,
std::string const &  imetadata 
)

Definition at line 28 of file IOVSequence.cc.

30  :
31  m_iovs(),
32  m_timetype(ttype),
33  m_lastTill(till),
34  m_notOrdered(false),
35  m_metadata(imetadata),
37  m_scope( Unknown ),
38  m_sorted(0) {}
std::string m_metadata
Definition: IOVSequence.h:115
Container m_iovs
Definition: IOVSequence.h:111
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:116
ScopeType m_scope
Definition: IOVSequence.h:117
Container * m_sorted
Definition: IOVSequence.h:119
cond::Time_t m_lastTill
Definition: IOVSequence.h:113
cond::IOVSequence::~IOVSequence ( )

Definition at line 40 of file IOVSequence.cc.

References m_sorted.

40  {
41  delete m_sorted;
42  }
Container * m_sorted
Definition: IOVSequence.h:119
cond::IOVSequence::IOVSequence ( IOVSequence const &  rh)

Definition at line 44 of file IOVSequence.cc.

44  :
45  UpdateStamp(rh),
46  m_iovs(rh.m_iovs),
47  m_timetype(rh.m_timetype),
48  m_lastTill(rh.m_lastTill),
49  m_notOrdered(rh.m_notOrdered),
50  m_metadata(rh.m_metadata),
51  m_payloadClasses(rh.m_payloadClasses),
52  m_scope( rh.m_scope ),
53  m_sorted(0) {}
std::string m_metadata
Definition: IOVSequence.h:115
Container m_iovs
Definition: IOVSequence.h:111
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:116
ScopeType m_scope
Definition: IOVSequence.h:117
Container * m_sorted
Definition: IOVSequence.h:119
cond::Time_t m_lastTill
Definition: IOVSequence.h:113

Member Function Documentation

size_t cond::IOVSequence::add ( cond::Time_t  time,
std::string const &  token,
std::string const &  payloadClassName 
)

Definition at line 95 of file IOVSequence.cc.

References prof2calltree::back, disorder(), relativeConstraints::empty, m_notOrdered, m_payloadClasses, piovs(), ora::QueryableVector< Tp >::push_back(), and ora::QueryableVector< Tp >::size().

97  {
98  if (!piovs().empty() && ( m_notOrdered || time<piovs().back().sinceTime())) disorder();
99  piovs().push_back(Item(time, token));
100  m_payloadClasses.insert( payloadClassName );
101  return piovs().size()-1;
102  }
Container & piovs()
Definition: IOVSequence.h:89
void push_back(const Tp &x)
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:116
cond::IOVElement Item
Definition: IOVSequence.h:25
void cond::IOVSequence::disorder ( )
private

Definition at line 142 of file IOVSequence.cc.

References m_notOrdered, and m_sorted.

Referenced by add(), and truncate().

142  {
143  m_notOrdered=true;
144  delete m_sorted; m_sorted=0;
145  }
Container * m_sorted
Definition: IOVSequence.h:119
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().

Referenced by cond::IOVImportIterator::setUp().

127  {
128  return findSince(time)!=iovs().end();
129  }
Container const & iovs() const
Definition: IOVSequence.cc:76
const_iterator findSince(cond::Time_t time) const
Definition: IOVSequence.cc:122
IOVSequence::const_iterator cond::IOVSequence::find ( cond::Time_t  time) const

Definition at line 110 of file IOVSequence.cc.

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

Referenced by BeautifulSoup.Tag::__getattr__(), findSince(), BeautifulSoup.Tag::firstText(), and cond::IOVImportIterator::setUp().

110  {
111  if (time>lastTill()) return iovs().end();
112  IOVSequence::const_iterator p = std::upper_bound(iovs().begin(),iovs().end(),Item(time),
113  boost::bind(std::less<cond::Time_t>(),
114  boost::bind(&Item::sinceTime,_1),
115  boost::bind(&Item::sinceTime,_2)
116  )
117  );
118  return (p!=iovs().begin()) ? p-1 : iovs().end();
119  }
cond::Time_t lastTill() const
Definition: IOVSequence.h:64
Container const & iovs() const
Definition: IOVSequence.cc:76
Container::const_iterator const_iterator
Definition: IOVSequence.h:28
#define end
Definition: vmac.h:37
cond::IOVElement Item
Definition: IOVSequence.h:25
cond::Time_t sinceTime() const
Definition: IOVElement.h:32
#define begin
Definition: vmac.h:30
IOVSequence::const_iterator cond::IOVSequence::findSince ( cond::Time_t  time) const

Definition at line 122 of file IOVSequence.cc.

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

Referenced by exist(), and cond::KeyList::load().

122  {
124  return (p!=iovs().end() && (*p).sinceTime()==time) ? p : iovs().end();
125  }
const_iterator find(cond::Time_t time) const
Definition: IOVSequence.cc:110
Container const & iovs() const
Definition: IOVSequence.cc:76
Container::const_iterator const_iterator
Definition: IOVSequence.h:28
#define end
Definition: vmac.h:37
cond::Time_t cond::IOVSequence::firstSince ( ) const
inline

Definition at line 62 of file IOVSequence.h.

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

Referenced by cond::IOVImportIterator::setUp().

62 { return iovs().front().sinceTime();}
Container const & iovs() const
Definition: IOVSequence.cc:76
IOVSequence::Container const & cond::IOVSequence::iovs ( ) const

Definition at line 76 of file IOVSequence.cc.

References m_iovs, m_notOrdered, m_sorted, and sortMe().

Referenced by cond::ExportIOVUtilities::execute(), exist(), find(), findSince(), firstSince(), cond::KeyList::load(), cond::IOVElementProxy::set(), and cond::IOVImportIterator::setUp().

76  {
77  if (m_sorted) return *m_sorted;
78  if (m_notOrdered) return sortMe();
79  return m_iovs;
80  }
Container m_iovs
Definition: IOVSequence.h:111
Container const & sortMe() const
Definition: IOVSequence.cc:82
Container * m_sorted
Definition: IOVSequence.h:119
cond::Time_t cond::IOVSequence::lastTill ( ) const
inline

Definition at line 64 of file IOVSequence.h.

References m_lastTill.

Referenced by cond::ExportIOVUtilities::execute(), find(), and cond::IOVElementProxy::set().

64 { return m_lastTill;}
cond::Time_t m_lastTill
Definition: IOVSequence.h:113
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().

69  {
70  // m_provenance.get();
71  // m_description.get();
72  // m_userMetadata.get();
73  m_iovs.load();
74  }
Container m_iovs
Definition: IOVSequence.h:111
std::string const& cond::IOVSequence::metadata ( ) const
inline

Definition at line 78 of file IOVSequence.h.

References m_metadata.

Referenced by cond::ExportIOVUtilities::execute(), and updateMetadata().

78 { return m_metadata;}
std::string m_metadata
Definition: IOVSequence.h:115
bool cond::IOVSequence::notOrdered ( ) const
inline

Definition at line 76 of file IOVSequence.h.

References m_notOrdered.

76 { 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.

55  {
56  delete m_sorted; m_sorted=0;
57 
58  m_iovs = rh.m_iovs;
59  m_timetype = rh.m_timetype;
60  m_lastTill=rh.m_lastTill;
61  m_notOrdered=rh.m_notOrdered;
62  m_metadata = rh.m_metadata;
63  m_payloadClasses = rh.m_payloadClasses;
64  m_scope = rh.m_scope;
65  return *this;
66  }
std::string m_metadata
Definition: IOVSequence.h:115
Container m_iovs
Definition: IOVSequence.h:111
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:116
ScopeType m_scope
Definition: IOVSequence.h:117
Container * m_sorted
Definition: IOVSequence.h:119
cond::Time_t m_lastTill
Definition: IOVSequence.h:113
std::set<std::string> const& cond::IOVSequence::payloadClasses ( ) const
inline

Definition at line 80 of file IOVSequence.h.

References m_payloadClasses.

80 { return m_payloadClasses; }
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:116
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().

89  {
90  m_iovs.load();
91  return m_iovs;
92  }
Container m_iovs
Definition: IOVSequence.h:111
Container const& cond::IOVSequence::piovs ( ) const
inline

Definition at line 93 of file IOVSequence.h.

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

93  {
94  m_iovs.load();
95  return m_iovs;
96  }
Container m_iovs
Definition: IOVSequence.h:111
ScopeType cond::IOVSequence::scope ( ) const
inline

Definition at line 82 of file IOVSequence.h.

References m_scope.

82 { return m_scope;}
ScopeType m_scope
Definition: IOVSequence.h:117
void cond::IOVSequence::setScope ( ScopeType  type)
inline

Definition at line 70 of file IOVSequence.h.

References m_scope.

70 { m_scope = type;}
type
Definition: HCALResponse.h:21
ScopeType m_scope
Definition: IOVSequence.h:117
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().

82  {
83  m_iovs.load();
84  delete m_sorted; // shall not be necessary;
85  Container * local = new Container(m_iovs);
86  std::sort(local->begin(), local->end(), boost::bind(std::less<cond::Time_t>(),
87  boost::bind(&Item::sinceTime,_1),
88  boost::bind(&Item::sinceTime,_2)
89  ) );
90  m_sorted = local;
91  return *m_sorted;
92  }
ora::QueryableVector< Item > Container
Definition: IOVSequence.h:26
Container m_iovs
Definition: IOVSequence.h:111
cond::Time_t sinceTime() const
Definition: IOVElement.h:32
Container * m_sorted
Definition: IOVSequence.h:119
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.

157  {
159  iT != m_iovs.end(); ++iT ){
160  iT->swapOId( writer );
161  }
162  }
Container m_iovs
Definition: IOVSequence.h:111
Container::const_iterator const_iterator
Definition: IOVSequence.h:28
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, m_payloadClasses, and AlCaHLTBitMon_QueryRunRegistry::string.

147  {
149  iT != m_iovs.end(); ++iT ){
150  iT->swapToken( parser );
151  // adding the classname 'by hand'
152  std::string className = parser.className( iT->token() );
153  const_cast<IOVSequence* >(this)->m_payloadClasses.insert( className );
154  }
155  }
virtual std::string className(const std::string &poolToken)=0
Container m_iovs
Definition: IOVSequence.h:111
Container::const_iterator const_iterator
Definition: IOVSequence.h:28
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:116
char const * className(const std::type_info &t)
Definition: ClassID.cc:8
cond::TimeType cond::IOVSequence::timeType ( ) const
inline

Definition at line 59 of file IOVSequence.h.

References m_timetype, cond::timeTypeSpecs, and cond::TimeTypeSpecs::type.

Referenced by cond::IOVElementProxy::set().

const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
TimeType type
Definition: Time.h:41
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.

66 { m_lastTill=till;}
cond::Time_t m_lastTill
Definition: IOVSequence.h:113
void cond::IOVSequence::updateMetadata ( const std::string &  metadata,
bool  append = true 
)

Definition at line 131 of file IOVSequence.cc.

References m_metadata, metadata(), and AlCaHLTBitMon_QueryRunRegistry::string.

132  {
133  std::string sep(". ");
134  if( !metadata.empty() ){
135  if (append && !m_metadata.empty()) {
136  m_metadata += sep + metadata;
137  }
138  else m_metadata = metadata;
139  }
140  }
std::string m_metadata
Definition: IOVSequence.h:115
std::string const & metadata() const
Definition: IOVSequence.h:78

Member Data Documentation

Container cond::IOVSequence::m_iovs
private

Definition at line 111 of file IOVSequence.h.

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

cond::Time_t cond::IOVSequence::m_lastTill
private

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

bool cond::IOVSequence::m_notOrdered
private

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

ScopeType cond::IOVSequence::m_scope
private

Definition at line 117 of file IOVSequence.h.

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

Container* cond::IOVSequence::m_sorted
mutableprivate

Definition at line 119 of file IOVSequence.h.

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

int cond::IOVSequence::m_timetype
private

Definition at line 112 of file IOVSequence.h.

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