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 24 of file IOVSequence.h.

Member Typedef Documentation

Definition at line 29 of file IOVSequence.h.

Definition at line 27 of file IOVSequence.h.

Definition at line 26 of file IOVSequence.h.

Definition at line 28 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:116
Container m_iovs
Definition: IOVSequence.h:112
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:117
ScopeType m_scope
Definition: IOVSequence.h:118
Container * m_sorted
Definition: IOVSequence.h:120
cond::Time_t m_lastTill
Definition: IOVSequence.h:114
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:116
Container m_iovs
Definition: IOVSequence.h:112
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:117
ScopeType m_scope
Definition: IOVSequence.h:118
Container * m_sorted
Definition: IOVSequence.h:120
cond::Time_t m_lastTill
Definition: IOVSequence.h:114
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:116
Container m_iovs
Definition: IOVSequence.h:112
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:117
ScopeType m_scope
Definition: IOVSequence.h:118
Container * m_sorted
Definition: IOVSequence.h:120
cond::Time_t m_lastTill
Definition: IOVSequence.h:114
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:120
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:116
Container m_iovs
Definition: IOVSequence.h:112
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:117
ScopeType m_scope
Definition: IOVSequence.h:118
Container * m_sorted
Definition: IOVSequence.h:120
cond::Time_t m_lastTill
Definition: IOVSequence.h:114

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:90
void push_back(const Tp &x)
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:117
cond::IOVElement Item
Definition: IOVSequence.h:26
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:120
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:65
Container const & iovs() const
Definition: IOVSequence.cc:76
Container::const_iterator const_iterator
Definition: IOVSequence.h:29
#define end
Definition: vmac.h:37
cond::IOVElement Item
Definition: IOVSequence.h:26
cond::Time_t sinceTime() const
Definition: IOVElement.h:33
#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:29
#define end
Definition: vmac.h:37
cond::Time_t cond::IOVSequence::firstSince ( ) const
inline

Definition at line 63 of file IOVSequence.h.

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

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

63 { 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:112
Container const & sortMe() const
Definition: IOVSequence.cc:82
Container * m_sorted
Definition: IOVSequence.h:120
cond::Time_t cond::IOVSequence::lastTill ( ) const
inline

Definition at line 65 of file IOVSequence.h.

References m_lastTill.

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

65 { return m_lastTill;}
cond::Time_t m_lastTill
Definition: IOVSequence.h:114
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:112
std::string const& cond::IOVSequence::metadata ( ) const
inline

Definition at line 79 of file IOVSequence.h.

References m_metadata.

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

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

Definition at line 77 of file IOVSequence.h.

References m_notOrdered.

77 { 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:116
Container m_iovs
Definition: IOVSequence.h:112
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:117
ScopeType m_scope
Definition: IOVSequence.h:118
Container * m_sorted
Definition: IOVSequence.h:120
cond::Time_t m_lastTill
Definition: IOVSequence.h:114
std::set<std::string> const& cond::IOVSequence::payloadClasses ( ) const
inline

Definition at line 81 of file IOVSequence.h.

References m_payloadClasses.

81 { return m_payloadClasses; }
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:117
Container& cond::IOVSequence::piovs ( )
inline

Definition at line 90 of file IOVSequence.h.

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

Referenced by add(), and truncate().

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

Definition at line 94 of file IOVSequence.h.

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

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

Definition at line 83 of file IOVSequence.h.

References m_scope.

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

Definition at line 71 of file IOVSequence.h.

References m_scope.

71 { m_scope = type;}
type
Definition: HCALResponse.h:21
ScopeType m_scope
Definition: IOVSequence.h:118
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:27
Container m_iovs
Definition: IOVSequence.h:112
cond::Time_t sinceTime() const
Definition: IOVElement.h:33
Container * m_sorted
Definition: IOVSequence.h:120
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:112
Container::const_iterator const_iterator
Definition: IOVSequence.h:29
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:112
Container::const_iterator const_iterator
Definition: IOVSequence.h:29
std::set< std::string > m_payloadClasses
Definition: IOVSequence.h:117
char const * className(const std::type_info &t)
Definition: ClassID.cc:8
cond::TimeType cond::IOVSequence::timeType ( ) const
inline

Definition at line 60 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 67 of file IOVSequence.h.

References m_lastTill.

67 { m_lastTill=till;}
cond::Time_t m_lastTill
Definition: IOVSequence.h:114
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:116
std::string const & metadata() const
Definition: IOVSequence.h:79

Member Data Documentation

Container cond::IOVSequence::m_iovs
private

Definition at line 112 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 114 of file IOVSequence.h.

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

std::string cond::IOVSequence::m_metadata
private

Definition at line 116 of file IOVSequence.h.

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

bool cond::IOVSequence::m_notOrdered
private

Definition at line 115 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 117 of file IOVSequence.h.

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

ScopeType cond::IOVSequence::m_scope
private

Definition at line 118 of file IOVSequence.h.

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

Container* cond::IOVSequence::m_sorted
mutableprivate

Definition at line 120 of file IOVSequence.h.

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

int cond::IOVSequence::m_timetype
private

Definition at line 113 of file IOVSequence.h.

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