ROOT  6.06/09
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 "TObject.h"
20 #include "Riosfwd.h"
21 #include "RooAbsProxy.h"
22 #include "RooAbsArg.h"
23 #include "RooArgSet.h"
24 
25 class RooSetProxy : public RooArgSet, public RooAbsProxy {
26 public:
27 
28 #ifdef USEMEMPOOL
29  void* operator new (size_t bytes);
30  void operator delete (void *ptr);
31 #endif
32 
33  // Constructors, assignment etc.
35  // coverity[UNINIT_CTOR]
36  _iter = createIterator() ; _owner = 0 ;
37  } ;
38  RooSetProxy(const char* name, const char* desc, RooAbsArg* owner,
39  Bool_t defValueServer=kTRUE, Bool_t defShapeServer=kFALSE) ;
40  RooSetProxy(const char* name, RooAbsArg* owner, const RooSetProxy& other) ;
41  virtual ~RooSetProxy() ;
42 
43  virtual const char* name() const { return GetName() ; }
44 
45  // List content management (modified for server hooks)
46  virtual Bool_t add(const RooAbsArg& var, Bool_t silent=kFALSE) ;
47  virtual Bool_t add(const RooAbsCollection& list, Bool_t silent=kFALSE) { return RooAbsCollection::add(list,silent) ; }
48  virtual Bool_t add(const RooAbsArg& var, Bool_t valueServer, Bool_t shapeServer, Bool_t silent) ;
49  virtual Bool_t addOwned(RooAbsArg& var, Bool_t silent=kFALSE);
50  virtual Bool_t addOwned(const RooAbsCollection& list, Bool_t silent=kFALSE) { return RooAbsCollection::addOwned(list,silent) ; }
51  virtual RooAbsArg *addClone(const RooAbsArg& var, Bool_t silent=kFALSE) ;
52  virtual void addClone(const RooAbsCollection& list, Bool_t silent=kFALSE) { RooAbsCollection::addClone(list,silent) ; }
53  virtual Bool_t replace(const RooAbsArg& var1, const RooAbsArg& var2) ;
54  virtual Bool_t remove(const RooAbsArg& var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) ;
55  Bool_t remove(const RooAbsCollection& list, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) ;
56  virtual void removeAll() ;
57 
58  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const ;
59 
60  RooSetProxy& operator=(const RooArgSet& other) ;
61 
62 protected:
63 
67  TIterator* _iter ; //! do not persist
68 
69  virtual Bool_t changePointer(const RooAbsCollection& newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE) ;
70 
71  ClassDef(RooSetProxy,1) // Proxy class for a RooArgSet
72 };
73 
74 #endif
75 
virtual Bool_t add(const RooAbsCollection &list, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Definition: RooSetProxy.h:47
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Bool_t _defValueServer
Definition: RooSetProxy.h:65
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
virtual Bool_t changePointer(const RooAbsCollection &newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE)
do not persist
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual void removeAll()
Remove all argument inset using remove(const RooAbsArg&).
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
Iterator abstract base class.
Definition: TIterator.h:32
#define ClassDef(name, id)
Definition: Rtypes.h:254
TIterator * createIterator(Bool_t dir=kIterForward) const
virtual void print(std::ostream &os, Bool_t addContents=kFALSE) const
Printing name of proxy on ostream.
virtual Bool_t replace(const RooAbsArg &var1, const RooAbsArg &var2)
Replace object 'var1' in set with 'var2'.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::addOwned() method insert object into owning set and registers object as server ...
RooAbsArg * _owner
Definition: RooSetProxy.h:64
RooSetProxy & operator=(const RooArgSet &other)
Assign values of arguments on other set to arguments in this set.
TIterator * _iter
Definition: RooSetProxy.h:67
Bool_t _defShapeServer
Definition: RooSetProxy.h:66
virtual void addClone(const RooAbsCollection &list, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
Definition: RooSetProxy.h:52
virtual const char * name() const
Definition: RooSetProxy.h:43
virtual ~RooSetProxy()
Destructor.
virtual Bool_t addOwned(const RooAbsCollection &list, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
Definition: RooSetProxy.h:50
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::addClone() method insert clone of object into owning set and registers cloned o...
const Bool_t kTRUE
Definition: Rtypes.h:91
const char * GetName() const
Returns name of object.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...