Logo ROOT  
Reference Guide
RooSetProxy.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooSetProxy.h,v 1.21 2007/07/13 21:24:36 wouter Exp $
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 #ifndef ROO_SET_PROXY
17 #define ROO_SET_PROXY
18 
19 #include "RooAbsProxy.h"
20 #include "RooAbsArg.h"
21 #include "RooArgSet.h"
22 
23 class RooSetProxy final : public RooArgSet, public RooAbsProxy {
24 public:
25 
26 #ifdef USEMEMPOOLFORARGSET
27  void* operator new (size_t bytes);
28  void operator delete (void *ptr);
29 #endif
30 
31  // Constructors, assignment etc.
33  _owner{nullptr},
34  _defValueServer{false},
35  _defShapeServer{false} { }
36 
37  RooSetProxy(const char* name, const char* desc, RooAbsArg* owner,
38  Bool_t defValueServer=kTRUE, Bool_t defShapeServer=kFALSE) ;
39  RooSetProxy(const char* name, RooAbsArg* owner, const RooSetProxy& other) ;
40  virtual ~RooSetProxy() ;
41 
42  virtual const char* name() const override { return GetName() ; }
43 
44  // List content management (modified for server hooks)
46  virtual Bool_t add(const RooAbsArg& var, Bool_t silent=kFALSE) override;
47  virtual Bool_t add(const RooAbsArg& var, Bool_t valueServer, Bool_t shapeServer, Bool_t silent) ;
48 
50  virtual Bool_t addOwned(RooAbsArg& var, Bool_t silent=kFALSE) override;
51 
53  virtual RooAbsArg *addClone(const RooAbsArg& var, Bool_t silent=kFALSE) override;
54 
55  virtual Bool_t replace(const RooAbsArg& var1, const RooAbsArg& var2) override;
56  virtual Bool_t remove(const RooAbsArg& var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) override;
57  Bool_t remove(const RooAbsCollection& list, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) ;
58  virtual void removeAll() override;
59 
60  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const override;
61 
62  RooSetProxy& operator=(const RooArgSet& other) ;
63 
64 protected:
65 
69 
70  virtual Bool_t changePointer(const RooAbsCollection& newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE) override;
71 
72  ClassDefOverride(RooSetProxy,1) // Proxy class for a RooArgSet
73 };
74 
75 #endif
76 
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooSetProxy::_defValueServer
Bool_t _defValueServer
Definition: RooSetProxy.h:67
RooArgSet.h
RooSetProxy
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:23
RooSetProxy::changePointer
virtual Bool_t changePointer(const RooAbsCollection &newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE) override
Process server change operation on owner.
Definition: RooSetProxy.cxx:264
RooSetProxy::RooSetProxy
RooSetProxy()
Definition: RooSetProxy.h:32
RooAbsArg.h
ClassDefOverride
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
RooAbsCollection::GetName
const char * GetName() const
Returns name of object.
Definition: RooAbsCollection.h:227
RooSetProxy::remove
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) override
Remove object 'var' from set and deregister 'var' as server to owner.
Definition: RooSetProxy.cxx:193
RooSetProxy::replace
virtual Bool_t replace(const RooAbsArg &var1, const RooAbsArg &var2) override
Replace object 'var1' in set with 'var2'.
Definition: RooSetProxy.cxx:177
bool
RooSetProxy::_owner
RooAbsArg * _owner
Definition: RooSetProxy.h:66
RooSetProxy::addOwned
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:389
RooSetProxy::name
virtual const char * name() const override
Definition: RooSetProxy.h:42
RooAbsProxy.h
RooSetProxy::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:437
RooAbsCollection::addClone
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
Definition: RooAbsCollection.cxx:412
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooAbsCollection
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
Definition: RooAbsCollection.h:31
RooAbsCollection::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:437
RooSetProxy::addClone
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
Definition: RooAbsCollection.cxx:412
RooAbsCollection::addOwned
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:389
RooSetProxy::operator=
RooSetProxy & operator=(const RooArgSet &other)
Assign values of arguments on other set to arguments in this set.
Definition: RooSetProxy.cxx:251
RooSetProxy::removeAll
virtual void removeAll() override
Remove all argument inset using remove(const RooAbsArg&).
Definition: RooSetProxy.cxx:229
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooAbsProxy
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:30
RooSetProxy::_defShapeServer
Bool_t _defShapeServer
Definition: RooSetProxy.h:68
RooSetProxy::print
virtual void print(std::ostream &os, Bool_t addContents=kFALSE) const override
Printing name of proxy on ostream.
Definition: RooSetProxy.cxx:292
RooSetProxy::~RooSetProxy
virtual ~RooSetProxy()
Destructor.
Definition: RooSetProxy.cxx:105
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29