Logo ROOT   6.18/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
24class RooSetProxy final : public RooArgSet, public RooAbsProxy {
25public:
26
27#ifdef USEMEMPOOLFORARGSET
28 void* operator new (size_t bytes);
29 void operator delete (void *ptr);
30#endif
31
32 // Constructors, assignment etc.
34 _owner{nullptr},
35 _defValueServer{false},
36 _defShapeServer{false} { }
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
62protected:
63
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
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:70
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
const char * GetName() const
Returns name of object.
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:31
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:24
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...
virtual const char * name() const
Definition: RooSetProxy.h:43
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
virtual void print(std::ostream &os, Bool_t addContents=kFALSE) const
Printing name of proxy on ostream.
RooSetProxy & operator=(const RooArgSet &other)
Assign values of arguments on other set to arguments in this set.
virtual ~RooSetProxy()
Destructor.
virtual Bool_t replace(const RooAbsArg &var1, const RooAbsArg &var2)
Replace object 'var1' in set with 'var2'.
Bool_t _defValueServer
Definition: RooSetProxy.h:65
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...
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove object 'var' from set and deregister 'var' as server to owner.
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
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
Bool_t _defShapeServer
Definition: RooSetProxy.h:66
virtual Bool_t changePointer(const RooAbsCollection &newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE)
Process server change operation on owner.
virtual void removeAll()
Remove all argument inset using remove(const RooAbsArg&).
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