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 23 of file IOVProxy.cc.

References data, and bookConverter::min.

24  {
25  int low = -1;
26  int high = -1;
27  if( data->iovs().size() ){
28  cond::Time_t firstSince = data->iovs().front().sinceTime();
29  if( till >= firstSince ){
30  low = (since < firstSince) ? 0 :
31  data->find(since)-data->iovs().begin();
32  high = data->find(till) - data->iovs().begin();
33  high = std::min( high+1,(int)data->iovs().size())-1;
34  }
35  }
36  return std::make_pair( low, high );
37 }
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 6 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().

6  {
7  if( token.empty() ) return;
9  // loading the lazy-loading Queryable vector...
10  data->loadAll();
11  //**** temporary for the schema transition
12  if( dbSession.isOldSchema() ){
13  PoolTokenParser parser( dbSession.storage() );
14  data->swapTokens( parser );
15  }
16 }
bool isOldSchema()
Definition: DbSession.cc:230
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:126
ora::Database & storage()
Definition: DbSession.cc:215
cond::DbSession dbSession
Definition: IOVProxy.h:42
void cond::IOVProxyData::refresh ( cond::DbSession dbs)

Definition at line 18 of file IOVProxy.cc.

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

18  {
19  dbSession = newSession;
20  refresh();
21 }
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().