Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooArgProxy.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooArgProxy.h,v 1.21 2007/07/12 20:30:28 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_ARG_PROXY
17 #define ROO_ARG_PROXY
18 
19 #include "TNamed.h"
20 #include "RooAbsProxy.h"
21 #include "RooAbsArg.h"
22 
23 
24 class RooArgProxy : public TNamed, public RooAbsProxy {
25 public:
26 
27  // Constructors, assignment etc.
28  RooArgProxy() : _owner(0), _arg(0), _valueServer(kFALSE), _shapeServer(kFALSE), _isFund(kTRUE), _ownArg(kFALSE) {
29  // Default constructor
30  } ;
31  RooArgProxy(const char* name, const char* desc, RooAbsArg* owner,
32  Bool_t valueServer, Bool_t shapeServer, Bool_t proxyOwnsArg=kFALSE) ;
33  RooArgProxy(const char* name, const char* desc, RooAbsArg* owner, RooAbsArg& arg,
34  Bool_t valueServer, Bool_t shapeServer, Bool_t proxyOwnsArg=kFALSE) ;
35  RooArgProxy(const char* name, RooAbsArg* owner, const RooArgProxy& other) ;
36  virtual ~RooArgProxy() ;
37  inline RooAbsArg* absArg() const {
38  // Return pointer to contained argument
39  return _arg ;
40  }
41 
42  virtual const char* name() const {
43  // Return name of proxy
44  return GetName() ;
45  }
46  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const ;
47 
48 protected:
49 
50  friend class RooSimultaneous ;
51  RooAbsArg* _owner ; // Pointer to owner of proxy
52  RooAbsArg* _arg ; // Pointer to content of proxy
53 
54  Bool_t _valueServer ; // If true contents is value server of owner
55  Bool_t _shapeServer ; // If true contents is shape server of owner
56  Bool_t _isFund ; // If true proxy contains an lvalue
57  Bool_t _ownArg ; // If true proxy owns contents
58 
59  friend class RooAbsArg ;
60 
61  inline Bool_t isValueServer() const {
62  // Returns true of contents is value server of owner
63  return _valueServer ;
64  }
65  inline Bool_t isShapeServer() const {
66  // Returns true if contents is shape server of owner
67  return _shapeServer ;
68  }
69  virtual Bool_t changePointer(const RooAbsCollection& newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE) ;
70 
71  virtual void changeDataSet(const RooArgSet* newNormSet) ;
72 
73  ClassDef(RooArgProxy,1) // Abstract proxy for RooAbsArg objects
74 };
75 
76 #endif
77