6 namespace persistency {
42 m_timeType( timeType ),
43 m_endOfValidity( endOfValidity ){
47 m_current( rhs.m_current ),
49 m_timeType( rhs.m_timeType ),
50 m_endOfValidity( rhs.m_endOfValidity ){
65 retVal.
since = std::get<0>(*m_current);
66 auto next = m_current;
70 retVal.
till = m_endOfValidity;
77 retVal.
payloadId = std::get<1>(*m_current);
93 if( m_current != rhs.
m_current )
return false;
94 if( m_end != rhs.
m_end )
return false;
109 m_session( session ){
113 m_data( rhs.m_data ),
114 m_session( rhs.m_session ){
130 m_data->endOfValidity, dummy,
m_data->lastValidatedTime ) ){
131 throwException(
"Tag \""+tag+
"\" has not been found in the database.",
"IOVProxy::load");
155 m_data->sinceGroups.clear();
156 m_data->iovSequence.clear();
157 m_data->numberOfQueries = 0;
182 return m_data.get() ? (
m_data->sinceGroups.size()==0 &&
m_data->iovSequence.size()==0 ) :
true;
191 m_data->iovSequence.clear();
192 m_session->iovSchema().iovTable().selectLatestByGroup(
m_data->tag, lowerGroup, higherGroup,
m_data->iovSequence );
194 m_data->lowerGroup = lowerGroup;
195 m_data->higherGroup = higherGroup;
197 m_data->numberOfQueries++;
224 template <
typename T>
typename std::vector<T>::const_iterator
search(
const cond::Time_t& val,
const std::vector<T>& container ){
225 if( !container.size() )
return container.end();
226 auto p = std::upper_bound( container.begin(), container.end(), val,
IOVComp() );
227 return (
p!= container.begin()) ?
p-1 : container.end();
237 time < m_data->lowerGroup || time>=
m_data->higherGroup ){
242 if( iGLow ==
m_data->sinceGroups.end() ){
249 if( iGLow !=
m_data->sinceGroups.begin() ){
256 if( iGHigh !=
m_data->sinceGroups.end() ) {
258 if( iGHigh !=
m_data->sinceGroups.end() ) highG = *iGHigh;
271 if( valid ==
end() ){
272 throwException(
"Can't find a valid interval for the specified time.",
"IOVProxy::getInterval");
void fetchSequence(cond::Time_t lowerGroup, cond::Time_t higherGroup)
cond::Time_t endOfValidity
void checkTransaction(const std::string &ctx) const
cond::Time_t m_endOfValidity
std::shared_ptr< SessionImpl > m_session
bool operator()(const cond::Time_t &x, const std::tuple< cond::Time_t, cond::Hash > &y)
bool operator()(const cond::Time_t &x, const cond::Time_t &y)
IOVProxy & operator=(const IOVProxy &rhs)
void load(const std::string &tag, bool full=false)
std::vector< T >::const_iterator search(const cond::Time_t &val, const std::vector< T > &container)
bool operator==(const CaloTower &t1, const CaloTower &t2)
std::pair< cond::Time_t, cond::Time_t > loadedGroup() const
std::string payloadObjectType() const
bool operator!=(const Iterator &rhs) const
IOVProxy::IOVContainer iovSequence
Iterator & operator=(const Iterator &rhs)
cond::TimeType timeType() const
unsigned long long Time_t
IOVContainer::const_iterator m_current
std::vector< std::tuple< cond::Time_t, cond::Hash > > IOVContainer
Iterator find(cond::Time_t time)
cond::Iov_t getInterval(cond::Time_t time)
IOVContainer::const_iterator m_end
cond::Time_t endOfValidity() const
cond::TimeType m_timeType
cond::Time_t lastValidatedTime
cond::Time_t lastValidatedTime() const
std::shared_ptr< IOVProxyData > m_data
Time_t tillTimeFromNextSince(Time_t nextSince, TimeType timeType)
std::vector< std::vector< double > > tmp
bool operator==(const Iterator &rhs) const
std::vector< cond::Time_t > sinceGroups
size_t numberOfQueries() const
const Time_t MAX_VAL(std::numeric_limits< Time_t >::max())
void throwException(const std::string &message, const std::string &methodName)
const std::shared_ptr< SessionImpl > & session() const