4 #include <openssl/sha.h> 8 namespace persistency {
14 bool RUN_INFO::Table::Table::exists(){
21 "RUN_INFO::Table::create");
34 std::tie( start, end ) =
r;
47 }
catch (
const coral::AttributeException&
e ){
49 if(
message.find(
"Attempt to access data of NULL attribute" ) != 0 )
throw;
55 std::vector<std::tuple<cond::Time_t,boost::posix_time::ptime,boost::posix_time::ptime> >& runData ){
59 for(
auto r: q0 ) upper = std::get<0>(
r);
62 q1.addCondition<
RUN_NUMBER >( lower,
">=").addCondition< RUN_NUMBER >( upper,
"<=");
63 size_t prevSize = runData.size();
65 runData.push_back(
r );
67 return runData.size()>prevSize;
71 std::vector<std::tuple<cond::Time_t,boost::posix_time::ptime,boost::posix_time::ptime> >& runData ){
72 boost::posix_time::ptime
up =
upper;
76 for(
auto r: q0 ) up = std::get<0>(
r);
79 q1.addCondition<
END_TIME >( lower,
">=").addCondition< START_TIME >( up,
"<=");
80 size_t prevSize = runData.size();
82 runData.push_back(
r );
84 return runData.size()>prevSize;
106 m_runInfoTable( schema ){
115 bool created =
false;
cond::Time_t getLastInserted()
IRunInfoTable & runInfoTable()
coral::ISchema & m_schema
const coral::TableDescription & get()
RUN_INFO::Table m_runInfoTable
void insert(const P ¶ms)
bool getInclusiveTimeRange(const boost::posix_time::ptime &lower, const boost::posix_time::ptime &upper, std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runData)
void insert(const std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runs)
unsigned long long Time_t
const coral::AttributeList & get() const
static char const * tname
Query & addCondition(const T &value, const std::string condition="=")
bool getInclusiveRunRange(cond::Time_t lower, cond::Time_t upper, std::vector< std::tuple< cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime > > &runData)
void insertOne(cond::Time_t runNumber, const boost::posix_time::ptime &start, const boost::posix_time::ptime &end)
void updateEnd(cond::Time_t runNumber, const boost::posix_time::ptime &end)
bool select(cond::Time_t runNumber, boost::posix_time::ptime &start, boost::posix_time::ptime &end)
void setColumnData(const Params ¶ms)
Table(coral::ISchema &schema)
RunInfoSchema(coral::ISchema &schema)
void addWhereCondition(const P ¶m, const std::string condition="=")
void throwException(const std::string &message, const std::string &methodName)