6 namespace persistency {
43 m_timeType( timeType ),
44 m_endOfValidity( endOfValidity ){
48 m_current( rhs.m_current ),
50 m_timeType( rhs.m_timeType ),
51 m_endOfValidity( rhs.m_endOfValidity ){
66 retVal.
since = std::get<0>(*m_current);
67 auto next = m_current;
71 retVal.
till = m_endOfValidity;
78 retVal.
payloadId = std::get<1>(*m_current);
94 if( m_current != rhs.
m_current )
return false;
95 if( m_end != rhs.
m_end )
return false;
110 m_session( session ){
114 m_data( rhs.m_data ),
115 m_session( rhs.m_session ){
131 m_data->endOfValidity, dummy,
m_data->lastValidatedTime ) ){
132 throwException(
"Tag \""+tag+
"\" has not been found in the database.",
"IOVProxy::load");
156 m_data->sinceGroups.clear();
157 m_data->iovSequence.clear();
158 m_data->numberOfQueries = 0;
189 std::tuple<std::string, boost::posix_time::ptime, boost::posix_time::ptime >
ret;
190 if(!
m_session->iovSchema().tagTable().getMetadata(
m_data->tag, std::get<0>( ret ), std::get<1>( ret ), std::get<2>( ret ) ) ){
191 throwException(
"Metadata for tag \""+
m_data->tag+
"\" have not been found in the database.",
"IOVProxy::getMetadata()");
197 return m_data.get() ? (
m_data->sinceGroups.size()==0 &&
m_data->iovSequence.size()==0 ) :
true;
206 m_data->iovSequence.clear();
207 m_session->iovSchema().iovTable().selectLatestByGroup(
m_data->tag, lowerGroup, higherGroup,
m_data->iovSequence );
209 if(
m_data->iovSequence.empty() ){
214 m_data->groupLowerIov = std::get<0>(
m_data->iovSequence.front() );
219 m_data->groupHigherIov = std::get<0>(
m_data->iovSequence.back());
225 m_data->numberOfQueries++;
252 template <
typename T>
typename std::vector<T>::const_iterator
search(
const cond::Time_t& val,
const std::vector<T>& container ){
253 if( !container.size() )
return container.end();
254 auto p = std::upper_bound( container.begin(), container.end(), val,
IOVComp() );
255 return (
p!= container.begin()) ?
p-1 : container.end();
305 if( valid ==
end() ){
306 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::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
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
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
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)
std::vector< T >::const_iterator search(const cond::Time_t &val, const std::vector< T > &container)
const std::shared_ptr< SessionImpl > & session() const