Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsCache.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooAbsCache.cxx
19\class RooAbsCache
20\ingroup Roofitcore
21
22Abstract base class for data members of RooAbsArgs
23that cache other (composite) RooAbsArg expressions. The RooAbsCache
24interface defines the interaction between the owning RooAbsArg object
25and the cache data member to communicate server redirects, operation
26mode changes and constant term optimization management calls.
27**/
28
29#include "RooAbsCache.h"
30#include "RooAbsArg.h"
31#include "RooArgList.h"
32
33using namespace std;
34
36
37
38////////////////////////////////////////////////////////////////////////////////
39/// Constructor. Takes owner as argument and register cache with owner.
40
41RooAbsCache::RooAbsCache(RooAbsArg* owner) : _owner(owner)
42{
43 if (_owner) {
44 _owner->registerCache(*this) ;
45 }
46}
47
48
49////////////////////////////////////////////////////////////////////////////////
50/// Copy constructor. Takes owner as argument and registers cache with owne.
51
52RooAbsCache::RooAbsCache(const RooAbsCache&, RooAbsArg* owner ) : _owner(owner)
53{
54 if (_owner) {
55 owner->registerCache(*this) ;
56 }
57}
58
59
60////////////////////////////////////////////////////////////////////////////////
61/// Destructor. Unregisters cache with owner.
62
64{
65 if (_owner) {
66 _owner->unRegisterCache(*this) ;
67 }
68}
69
70
71////////////////////////////////////////////////////////////////////////////////
72/// Reset the owner, triggering the owner to register this cache in its list of caches.
74{
75 if (_owner) {
76 _owner->unRegisterCache(*this) ;
77 }
78 _owner = owner;
79 if (_owner) {
80 owner->registerCache(*this) ;
81 }
82}
#define ClassImp(name)
Definition Rtypes.h:377
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:79
void unRegisterCache(RooAbsCache &cache)
Unregister a RooAbsCache. Called from the RooAbsCache destructor.
void registerCache(RooAbsCache &cache)
Register RooAbsCache with this object.
Abstract base class for data members of RooAbsArgs that cache other (composite) RooAbsArg expressions...
Definition RooAbsCache.h:27
void setOwner(RooAbsArg *owner)
Reset the owner, triggering the owner to register this cache in its list of caches.
RooAbsArg * _owner
Pointer to owning RooAbsArg.
Definition RooAbsCache.h:61
RooAbsCache(RooAbsArg *owner=nullptr)
Constructor. Takes owner as argument and register cache with owner.
virtual ~RooAbsCache()
Destructor. Unregisters cache with owner.