6 namespace persistency {
38 m_timeType(
cond::invalid ),
73 retVal.
since = std::get<0>(*m_current);
86 retVal.
payloadId = std::get<1>(*m_current);
134 boost::posix_time::ptime notime;
135 load( tag, notime, full );
141 if( !
m_data.get() )
return;
150 m_data->endOfValidity, dummy,
m_data->lastValidatedTime ) ){
151 throwException(
"Tag \""+tag+
"\" has not been found in the database.",
"IOVProxy::load");
173 boost::posix_time::ptime no_time;
181 if( !
m_data.get() )
return;
190 m_data->endOfValidity, dummy,
m_data->lastValidatedTime ) ){
191 throwException(
"Tag \""+tag+
"\" has not been found in the database "+
m_session->connectionString,
"IOVProxy::loadRange");
195 m_session->iovSchema().iovTable().getRange(
m_data->tag, begin, end, snapshotTime,
m_data->iovSequence );
215 m_data->sinceGroups.clear();
216 m_data->iovSequence.clear();
217 m_data->numberOfQueries = 0;
250 std::tuple<std::string, boost::posix_time::ptime, boost::posix_time::ptime > ret;
251 if(!
m_session->iovSchema().tagTable().getMetadata(
m_data->tag, std::get<0>( ret ), std::get<1>( ret ), std::get<2>( ret ) ) ){
252 throwException(
"Metadata for tag \""+
m_data->tag+
"\" have not been found in the database.",
"IOVProxy::getMetadata()");
258 return m_data.get() ? (
m_data->sinceGroups.empty() &&
m_data->iovSequence.empty() ) :
true;
267 m_data->iovSequence.clear();
270 if(
m_data->iovSequence.empty() ){
275 m_data->groupLowerIov = std::get<0>(
m_data->iovSequence.front() );
280 m_data->groupHigherIov = higherGroup-1;
286 m_data->numberOfQueries++;
314 template <
typename T>
typename std::vector<T>::const_iterator
search(
const cond::Time_t&
val,
const std::vector<T>& container ){
315 if( container.empty() )
return container.end();
317 return (
p!= container.begin()) ?
p-1 : container.end();
325 time < m_data->groupLowerIov || time >=
m_data->groupHigherIov ){
330 if( iGLow ==
m_data->sinceGroups.end() ){
338 if( iGHigh !=
m_data->sinceGroups.end() ) highG = *iGHigh;
351 if( valid ==
end() ){
352 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
cond::SynchronizationType synchronizationType() const
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)
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)
std::tuple< std::string, boost::posix_time::ptime, boost::posix_time::ptime > getMetadata() const
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
boost::posix_time::ptime snapshotTime
cond::TimeType m_timeType
void loadRange(const std::string &tag, const cond::Time_t &begin, const cond::Time_t &end)
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
cond::Time_t groupHigherIov
cond::Time_t groupLowerIov
cond::SynchronizationType synchronizationType
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)
Time_t sinceGroupSize(TimeType tp)
const std::shared_ptr< SessionImpl > & session() const