CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
cond::IOVProxyData Struct Reference

#include <IOVProxy.h>

Public Member Functions

 IOVProxyData (cond::DbSession &dbs)
 
 IOVProxyData (cond::DbSession &dbs, const std::string &tok)
 
std::pair< int, int > range (cond::Time_t since, cond::Time_t till)
 
void refresh ()
 
void refresh (cond::DbSession &dbs)
 
 ~IOVProxyData ()
 

Public Attributes

boost::shared_ptr
< cond::IOVSequence
data
 
cond::DbSession dbSession
 
std::string token
 

Detailed Description

Definition at line 19 of file IOVProxy.h.

Constructor & Destructor Documentation

cond::IOVProxyData::IOVProxyData ( cond::DbSession dbs)
inlineexplicit

Definition at line 20 of file IOVProxy.h.

20  :
21  dbSession(dbs),
22  data(),
23  token(""){
24  }
boost::shared_ptr< cond::IOVSequence > data
Definition: IOVProxy.h:43
std::string token
Definition: IOVProxy.h:44
cond::DbSession dbSession
Definition: IOVProxy.h:42
cond::IOVProxyData::IOVProxyData ( cond::DbSession dbs,
const std::string &  tok 
)
inline

Definition at line 26 of file IOVProxy.h.

References refresh().

27  :
28  dbSession(dbs),
29  data(),
30  token(tok){
31  refresh();
32  }
boost::shared_ptr< cond::IOVSequence > data
Definition: IOVProxy.h:43
std::string token
Definition: IOVProxy.h:44
cond::DbSession dbSession
Definition: IOVProxy.h:42
cond::IOVProxyData::~IOVProxyData ( )
inline

Definition at line 34 of file IOVProxy.h.

34  {
35  }

Member Function Documentation

std::pair< int, int > cond::IOVProxyData::range ( cond::Time_t  since,
cond::Time_t  till 
)

Definition at line 20 of file IOVProxy.cc.

References data, and min.

21  {
22  int low = -1;
23  int high = -1;
24  if( data->iovs().size() ){
25  cond::Time_t firstSince = data->iovs().front().sinceTime();
26  if( till >= firstSince ){
27  low = (since < firstSince) ? 0 :
28  data->find(since)-data->iovs().begin();
29  high = data->find(till) - data->iovs().begin();
30  high = std::min( high+1,(int)data->iovs().size())-1;
31  }
32  }
33  return std::make_pair( low, high );
34 }
#define min(a, b)
Definition: mlp_lapack.h:161
unsigned long long Time_t
Definition: Time.h:16
boost::shared_ptr< cond::IOVSequence > data
Definition: IOVProxy.h:43
void cond::IOVProxyData::refresh ( )

Definition at line 4 of file IOVProxy.cc.

References data, dbSession, cond::DbSession::getTypedObject(), cond::DbSession::isOldSchema(), geometryXMLtoCSV::parser, cond::DbSession::storage(), and token.

Referenced by Vispa.Main.TabController.TabController::checkModificationTimestamp(), and IOVProxyData().

4  {
6  // loading the lazy-loading Queryable vector...
7  data->loadAll();
8  //**** temporary for the schema transition
9  if( dbSession.isOldSchema() ){
10  PoolTokenParser parser( dbSession.storage() );
11  data->swapTokens( parser );
12  }
13 }
bool isOldSchema()
Definition: DbSession.cc:215
boost::shared_ptr< cond::IOVSequence > data
Definition: IOVProxy.h:43
std::string token
Definition: IOVProxy.h:44
boost::shared_ptr< T > getTypedObject(const std::string &objectId)
Definition: DbSession.h:125
ora::Database & storage()
Definition: DbSession.cc:198
cond::DbSession dbSession
Definition: IOVProxy.h:42
void cond::IOVProxyData::refresh ( cond::DbSession dbs)

Definition at line 15 of file IOVProxy.cc.

Referenced by Vispa.Main.TabController.TabController::checkModificationTimestamp().

15  {
16  dbSession = newSession;
17  refresh();
18 }
cond::DbSession dbSession
Definition: IOVProxy.h:42

Member Data Documentation

boost::shared_ptr<cond::IOVSequence> cond::IOVProxyData::data
cond::DbSession cond::IOVProxyData::dbSession

Definition at line 42 of file IOVProxy.h.

Referenced by refresh().

std::string cond::IOVProxyData::token

Definition at line 44 of file IOVProxy.h.

Referenced by refresh().