Logo ROOT  
Reference Guide
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
22RooAbsCache is the abstract 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////////////////////////////////////////////////////////////////////////////////
40/// Constructor. Takes owner as argument and register cache with owner.
41
42RooAbsCache::RooAbsCache(RooAbsArg* owner) : _owner(owner)
43{
44 if (_owner) {
45 _owner->registerCache(*this) ;
46 }
47}
48
49
50////////////////////////////////////////////////////////////////////////////////
51/// Copy constructor. Takes owner as argument and registers cache with owne.
52
53RooAbsCache::RooAbsCache(const RooAbsCache&, RooAbsArg* owner ) : _owner(owner)
54{
55 if (_owner) {
56 owner->registerCache(*this) ;
57 }
58}
59
60
61////////////////////////////////////////////////////////////////////////////////
62/// Destructor. Unregisters cache with owner.
63
65{
66 if (_owner) {
67 _owner->unRegisterCache(*this) ;
68 }
69}
70
71
72////////////////////////////////////////////////////////////////////////////////
73/// Reset the owner, triggering the owner to register this cache in its list of caches.
75{
76 if (_owner) {
77 _owner->unRegisterCache(*this) ;
78 }
79 _owner = owner;
80 if (_owner) {
81 owner->registerCache(*this) ;
82 }
83}
#define ClassImp(name)
Definition: Rtypes.h:375
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
void unRegisterCache(RooAbsCache &cache)
Unregister a RooAbsCache. Called from the RooAbsCache destructor.
Definition: RooAbsArg.cxx:2029
void registerCache(RooAbsCache &cache)
Register RooAbsCache with this object.
Definition: RooAbsArg.cxx:2020
RooAbsCache is the abstract base class for data members of RooAbsArgs that cache other (composite) Ro...
Definition: RooAbsCache.h:27
void setOwner(RooAbsArg *owner)
Reset the owner, triggering the owner to register this cache in its list of caches.
Definition: RooAbsCache.cxx:74
RooAbsCache(RooAbsArg *owner=0)
Constructor. Takes owner as argument and register cache with owner.
Definition: RooAbsCache.cxx:42
RooAbsArg * _owner
Pointer to owning RooAbsArg.
Definition: RooAbsCache.h:61
virtual ~RooAbsCache()
Destructor. Unregisters cache with owner.
Definition: RooAbsCache.cxx:64