CMS 3D CMS Logo

Public Member Functions | Public Attributes

cond::IOVProxyData Struct Reference

#include <IOVProxy.h>

List of all members.

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) [inline, explicit]

Definition at line 20 of file IOVProxy.h.

                                                : 
      dbSession(dbs),
      data(), 
      token(""){
    }
cond::IOVProxyData::IOVProxyData ( cond::DbSession dbs,
const std::string &  tok 
) [inline]

Definition at line 26 of file IOVProxy.h.

References refresh().

                                        : 
      dbSession(dbs),
      data(), 
      token(tok){
      refresh();
    }
cond::IOVProxyData::~IOVProxyData ( ) [inline]

Definition at line 34 of file IOVProxy.h.

                   {  
    }

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 AlCaHLTBitMon_QueryRunRegistry::data, and min.

                                                                {
  int low = -1;
  int high = -1;
  if( data->iovs().size() ){
    cond::Time_t firstSince = data->iovs().front().sinceTime();
    if( till >= firstSince ){
      low = (since < firstSince) ? 0 :
        data->find(since)-data->iovs().begin();
      high = data->find(till) - data->iovs().begin();
      high = std::min( high+1,(int)data->iovs().size())-1;
    }
  }
  return std::make_pair( low, high );
}
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 IOVProxyData().

                              {
  data = dbSession.getTypedObject<cond::IOVSequence>( token );
  // loading the lazy-loading Queryable vector...
  data->loadAll();
  //**** temporary for the schema transition
  if( dbSession.isOldSchema() ){
    PoolTokenParser parser(  dbSession.storage() ); 
    data->swapTokens( parser );
  }
}
void cond::IOVProxyData::refresh ( cond::DbSession dbs)

Definition at line 15 of file IOVProxy.cc.

                                                         {
  dbSession = newSession;
  refresh();
}

Member Data Documentation

Definition at line 43 of file IOVProxy.h.

Referenced by refresh().

Definition at line 42 of file IOVProxy.h.

Referenced by refresh().

Definition at line 44 of file IOVProxy.h.

Referenced by refresh().