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
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
30#include "RooFit.h"
31#include "RooAbsCache.h"
32#include "RooAbsArg.h"
33#include "RooArgList.h"
34
35using namespace std;
36
38 ;
39
40
41////////////////////////////////////////////////////////////////////////////////
42/// Constructor. Takes owner as argument and register cache with owner.
43
44RooAbsCache::RooAbsCache(RooAbsArg* owner) : _owner(owner)
45{
46 if (_owner) {
47 _owner->registerCache(*this) ;
48 }
49}
50
51
52////////////////////////////////////////////////////////////////////////////////
53/// Copy constructor. Takes owner as argument and registers cache with owne.
54
55RooAbsCache::RooAbsCache(const RooAbsCache&, RooAbsArg* owner ) : _owner(owner)
56{
57 if (_owner) {
58 owner->registerCache(*this) ;
59 }
60}
61
62
63////////////////////////////////////////////////////////////////////////////////
64/// Destructor. Unregisters cache with owner.
65
67{
68 if (_owner) {
69 _owner->unRegisterCache(*this) ;
70 }
71}
72
73
74////////////////////////////////////////////////////////////////////////////////
75/// Reset the owner, triggering the owner to register this cache in its list of caches.
77{
78 if (_owner) {
79 _owner->unRegisterCache(*this) ;
80 }
81 _owner = owner;
82 if (_owner) {
83 owner->registerCache(*this) ;
84 }
85}
#define ClassImp(name)
Definition Rtypes.h:364
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition RooAbsArg.h:69
void unRegisterCache(RooAbsCache &cache)
Unregister a RooAbsCache. Called from the RooAbsCache destructor.
void registerCache(RooAbsCache &cache)
Register RooAbsCache with this object.
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.
RooAbsCache(RooAbsArg *owner=0)
Constructor. Takes owner as argument and register cache with owner.
RooAbsArg * _owner
Definition RooAbsCache.h:61
virtual ~RooAbsCache()
Destructor. Unregisters cache with owner.