Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes | Friends | List of all members
caf::SRProxySystController Class Reference

#include "SRProxy/BasicTypesProxy.h"

Static Public Member Functions

static bool AnyShifted ()
 
static void BeginTransaction ()
 
static bool InTransaction ()
 
static void Rollback ()
 
static long long Generation ()
 

Static Protected Member Functions

template<class T >
static void Backup (Proxy< T > &p)
 

Static Protected Attributes

static std::vector< Restorer * > fRestorers
 
static long long fGeneration = 0
 

Friends

template<class T >
class Proxy
 

Detailed Description

Definition at line 349 of file BasicTypesProxy.h.

Member Function Documentation

static bool caf::SRProxySystController::AnyShifted ( )
inlinestatic

Definition at line 352 of file BasicTypesProxy.h.

References r().

353  {
354  for(const Restorer* r: fRestorers) if(r) return true;
355  return false;
356  }
TRandom3 r(0)
static std::vector< Restorer * > fRestorers
template<class T >
static void caf::SRProxySystController::Backup ( Proxy< T > &  p)
inlinestaticprotected

Definition at line 387 of file BasicTypesProxy.h.

References caf::Restorer::Add(), and ana::assert().

Referenced by caf::Proxy< T >::operator=().

388  {
389  assert(!fRestorers.empty());
390  if(!fRestorers.back()){
391  ++fGeneration;
392  fRestorers.back() = new Restorer;
393  }
394  fRestorers.back()->Add(p);
395  }
const char * p
Definition: xmltok.h:285
assert(nhit_max >=nhit_nbins)
static std::vector< Restorer * > fRestorers
static long long fGeneration
static void caf::SRProxySystController::BeginTransaction ( )
inlinestatic

Definition at line 358 of file BasicTypesProxy.h.

Referenced by ana::SpectrumLoaderBase::GetNextFile(), ana::SystApplier::HandleRecord(), and ana::_preview::SystApplier::HandleRecord().

359  {
360  fRestorers.push_back(0);
361  }
static std::vector< Restorer * > fRestorers
static long long caf::SRProxySystController::Generation ( )
inlinestatic

May be useful in the implementation of caches that ought to be invalidated when systematic shifts are applied.

Definition at line 378 of file BasicTypesProxy.h.

379  {
380  if(!InTransaction()) return 0; // nominal
381  return fGeneration;
382  }
static long long fGeneration
static bool caf::SRProxySystController::InTransaction ( )
inlinestatic

Definition at line 363 of file BasicTypesProxy.h.

Referenced by caf::Proxy< T >::operator=().

364  {
365  return !fRestorers.empty();
366  }
static std::vector< Restorer * > fRestorers
static void caf::SRProxySystController::Rollback ( )
inlinestatic

Definition at line 368 of file BasicTypesProxy.h.

References ana::assert().

Referenced by ana::SpectrumLoaderBase::GetNextFile(), ana::SystApplier::HandleRecord(), and ana::_preview::SystApplier::HandleRecord().

369  {
370  assert(!fRestorers.empty());
371  if(fRestorers.back()) ++fGeneration;
372  delete fRestorers.back();
373  fRestorers.pop_back();
374  }
assert(nhit_max >=nhit_nbins)
static std::vector< Restorer * > fRestorers
static long long fGeneration

Friends And Related Function Documentation

template<class T >
friend class Proxy
friend

Definition at line 385 of file BasicTypesProxy.h.

Member Data Documentation

long long caf::SRProxySystController::fGeneration = 0
staticprotected

Definition at line 398 of file BasicTypesProxy.h.

std::vector< Restorer * > caf::SRProxySystController::fRestorers
staticprotected

Definition at line 397 of file BasicTypesProxy.h.


The documentation for this class was generated from the following files: