Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooListProxy.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooListProxy.h,v 1.11 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_LIST_PROXY
17 #define ROO_LIST_PROXY
18 
19 #include "TObject.h"
20 #include "RooAbsProxy.h"
21 #include "RooLinkedListIter.h"
22 #include "RooAbsArg.h"
23 #include "RooArgList.h"
24 
25 class RooListProxy final : public RooArgList, public RooAbsProxy {
26 public:
27 
28  // Constructors, assignment etc.
29  RooListProxy() : _defValueServer(kTRUE), _defShapeServer(kFALSE) { _owner=0 ; } ;
30  RooListProxy(const char* name, const char* desc, RooAbsArg* owner,
31  Bool_t defValueServer=kTRUE, Bool_t defShapeServer=kFALSE) ;
32  RooListProxy(const char* name, RooAbsArg* owner, const RooListProxy& other) ;
33  virtual ~RooListProxy() ;
34 
35  virtual const char* name() const { return GetName() ; }
36 
37  // List content management (modified for server hooks)
38  virtual Bool_t add(const RooAbsArg& var, Bool_t silent=kFALSE) ;
39  virtual Bool_t add(const RooAbsCollection& list, Bool_t silent=kFALSE) { return RooAbsCollection::add(list,silent) ; }
40  virtual Bool_t add(const RooAbsArg& var, Bool_t valueServer, Bool_t shapeServer, Bool_t silent) ;
41  virtual Bool_t addOwned(RooAbsArg& var, Bool_t silent=kFALSE);
42  virtual Bool_t addOwned(const RooAbsCollection& list, Bool_t silent=kFALSE) { return RooAbsCollection::addOwned(list,silent) ; }
43  virtual Bool_t replace(const RooAbsArg& var1, const RooAbsArg& var2) ;
44  virtual Bool_t remove(const RooAbsArg& var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE) ;
45  virtual void removeAll() ;
46 
47  RooListProxy& operator=(const RooArgList& other) ;
48 
49  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const ;
50 
51 protected:
52 
53  RooAbsArg* _owner ; // Pointer to owner
54  Bool_t _defValueServer ; // Propagate value dirty flags?
55  Bool_t _defShapeServer ; // Propagate shape dirty flags?
56 
57  virtual Bool_t changePointer(const RooAbsCollection& newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE) ;
58 
59  ClassDef(RooListProxy,1) // Proxy class for a RooArgList
60 };
61 
62 #endif
63