Logo ROOT   6.14/05
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 "RooAbsProxy.h"
21 #include "RooAbsArg.h"
22 #include "RooArgSet.h"
23 
24 class RooSetProxy : public RooArgSet, public RooAbsProxy {
25 public:
26 
27 #ifdef USEMEMPOOL
28  void* operator new (size_t bytes);
29  void operator delete (void *ptr);
30 #endif
31 
32  // Constructors, assignment etc.
34  // coverity[UNINIT_CTOR]
35  _iter = createIterator() ; _owner = 0 ;
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 { return GetName() ; }
43 
44  // List content management (modified for server hooks)
45  virtual Bool_t add(const RooAbsArg& var, Bool_t silent=kFALSE) ;
46  virtual Bool_t add(const RooAbsCollection& list, Bool_t silent=kFALSE) { return RooAbsCollection::add(list,silent) ; }
47  virtual Bool_t add(const RooAbsArg& var, Bool_t valueServer, Bool_t shapeServer, Bool_t silent) ;
48  virtual Bool_t addOwned(RooAbsArg& var, Bool_t silent=kFALSE);
49  virtual Bool_t addOwned(const RooAbsCollection& list, Bool_t silent=kFALSE) { return RooAbsCollection::addOwned(list,silent) ; }
50  virtual RooAbsArg *addClone(const RooAbsArg& var, Bool_t silent=kFALSE) ;
51  virtual void addClone(const RooAbsCollection& list, Bool_t silent=kFALSE) { RooAbsCollection::addClone(list,silent) ; }
52  virtual Bool_t replace(const RooAbsArg& var1, const RooAbsArg& var2) ;
53  virtual Bool_t remove(const RooAbsArg& var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) ;
54  Bool_t remove(const RooAbsCollection& list, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) ;
55  virtual void removeAll() ;
56 
57  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const ;
58 
59  RooSetProxy& operator=(const RooArgSet& other) ;
60 
61 protected:
62 
66  TIterator* _iter ; //! do not persist
67 
68  virtual Bool_t changePointer(const RooAbsCollection& newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE) ;
69 
70  ClassDef(RooSetProxy,1) // Proxy class for a RooArgSet
71 };
72 
73 #endif
74 
TIterator * createIterator(Bool_t dir=kIterForward) const
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:46
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Bool_t _defValueServer
Definition: RooSetProxy.h:64
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
Iterator abstract base class.
Definition: TIterator.h:30
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual Bool_t replace(const RooAbsArg &var1, const RooAbsArg &var2)
Replace object 'var1' in set with 'var2'.
virtual const char * name() const
Definition: RooSetProxy.h:42
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:31
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:63
RooSetProxy & operator=(const RooArgSet &other)
Assign values of arguments on other set to arguments in this set.
const Bool_t kFALSE
Definition: RtypesCore.h:88
TIterator * _iter
Definition: RooSetProxy.h:66
Bool_t _defShapeServer
Definition: RooSetProxy.h:65
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:51
const char * GetName() const
Returns name of object.
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects...
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:49
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:24
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: RtypesCore.h:87
virtual void print(std::ostream &os, Bool_t addContents=kFALSE) const
Printing name of proxy on ostream.
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...