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 350 of file BasicTypesProxy.h.

Member Function Documentation

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

Definition at line 353 of file BasicTypesProxy.h.

References r().

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

Definition at line 388 of file BasicTypesProxy.h.

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

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

389  {
390  assert(!fRestorers.empty());
391  if(!fRestorers.back()){
392  ++fGeneration;
393  fRestorers.back() = new Restorer;
394  }
395  fRestorers.back()->Add(p);
396  }
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 359 of file BasicTypesProxy.h.

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

360  {
361  fRestorers.push_back(0);
362  }
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 379 of file BasicTypesProxy.h.

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

Definition at line 364 of file BasicTypesProxy.h.

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

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

Definition at line 369 of file BasicTypesProxy.h.

References ana::assert().

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

370  {
371  assert(!fRestorers.empty());
372  if(fRestorers.back()) ++fGeneration;
373  delete fRestorers.back();
374  fRestorers.pop_back();
375  }
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 386 of file BasicTypesProxy.h.

Member Data Documentation

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

Definition at line 399 of file BasicTypesProxy.h.

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

Definition at line 398 of file BasicTypesProxy.h.


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