ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooArgProxy.h,v 1.21 2007/07/12 20:30:28 wouter Exp $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_ARG_PROXY
#define ROO_ARG_PROXY

#include "TNamed.h"
#include "RooAbsProxy.h"
#include "RooAbsArg.h"


class RooArgProxy : public TNamed, public RooAbsProxy  {
public:

  // Constructors, assignment etc.
  RooArgProxy() : _owner(0), _arg(0), _valueServer(kFALSE), _shapeServer(kFALSE), _isFund(kTRUE), _ownArg(kFALSE) {
    // Default constructor
  } ;
  RooArgProxy(const char* name, const char* desc, RooAbsArg* owner,
	      Bool_t valueServer, Bool_t shapeServer, Bool_t proxyOwnsArg=kFALSE) ;
  RooArgProxy(const char* name, const char* desc, RooAbsArg* owner, RooAbsArg& arg, 
	      Bool_t valueServer, Bool_t shapeServer, Bool_t proxyOwnsArg=kFALSE) ;
  RooArgProxy(const char* name, RooAbsArg* owner, const RooArgProxy& other) ;
  virtual ~RooArgProxy() ;
  inline RooAbsArg* absArg() const { 
    // Return pointer to contained argument
    return _arg ; 
  }

  virtual const char* name() const { 
    // Return name of proxy
    return GetName() ; 
  }
  virtual void print(std::ostream& os, Bool_t addContents=kFALSE) const ;

protected:

  friend class RooSimultaneous ;
  RooAbsArg* _owner ;       // Pointer to owner of proxy
  RooAbsArg* _arg ;         // Pointer to content of proxy

  Bool_t _valueServer ;     // If true contents is value server of owner
  Bool_t _shapeServer ;     // If true contents is shape server of owner
  Bool_t _isFund ;          // If true proxy contains an lvalue
  Bool_t _ownArg ;          // If true proxy owns contents

  friend class RooAbsArg ;

  inline Bool_t isValueServer() const { 
    // Returns true of contents is value server of owner
    return _valueServer ; 
  }
  inline Bool_t isShapeServer() const { 
    // Returns true if contents is shape server of owner
    return _shapeServer ; 
  }
  virtual Bool_t changePointer(const RooAbsCollection& newServerSet, Bool_t nameChange=kFALSE, Bool_t factoryInitMode=kFALSE) ;

  virtual void changeDataSet(const RooArgSet* newNormSet) ;

  ClassDef(RooArgProxy,1) // Abstract proxy for RooAbsArg objects
};

#endif

 RooArgProxy.h:1
 RooArgProxy.h:2
 RooArgProxy.h:3
 RooArgProxy.h:4
 RooArgProxy.h:5
 RooArgProxy.h:6
 RooArgProxy.h:7
 RooArgProxy.h:8
 RooArgProxy.h:9
 RooArgProxy.h:10
 RooArgProxy.h:11
 RooArgProxy.h:12
 RooArgProxy.h:13
 RooArgProxy.h:14
 RooArgProxy.h:15
 RooArgProxy.h:16
 RooArgProxy.h:17
 RooArgProxy.h:18
 RooArgProxy.h:19
 RooArgProxy.h:20
 RooArgProxy.h:21
 RooArgProxy.h:22
 RooArgProxy.h:23
 RooArgProxy.h:24
 RooArgProxy.h:25
 RooArgProxy.h:26
 RooArgProxy.h:27
 RooArgProxy.h:28
 RooArgProxy.h:29
 RooArgProxy.h:30
 RooArgProxy.h:31
 RooArgProxy.h:32
 RooArgProxy.h:33
 RooArgProxy.h:34
 RooArgProxy.h:35
 RooArgProxy.h:36
 RooArgProxy.h:37
 RooArgProxy.h:38
 RooArgProxy.h:39
 RooArgProxy.h:40
 RooArgProxy.h:41
 RooArgProxy.h:42
 RooArgProxy.h:43
 RooArgProxy.h:44
 RooArgProxy.h:45
 RooArgProxy.h:46
 RooArgProxy.h:47
 RooArgProxy.h:48
 RooArgProxy.h:49
 RooArgProxy.h:50
 RooArgProxy.h:51
 RooArgProxy.h:52
 RooArgProxy.h:53
 RooArgProxy.h:54
 RooArgProxy.h:55
 RooArgProxy.h:56
 RooArgProxy.h:57
 RooArgProxy.h:58
 RooArgProxy.h:59
 RooArgProxy.h:60
 RooArgProxy.h:61
 RooArgProxy.h:62
 RooArgProxy.h:63
 RooArgProxy.h:64
 RooArgProxy.h:65
 RooArgProxy.h:66
 RooArgProxy.h:67
 RooArgProxy.h:68
 RooArgProxy.h:69
 RooArgProxy.h:70
 RooArgProxy.h:71
 RooArgProxy.h:72
 RooArgProxy.h:73
 RooArgProxy.h:74
 RooArgProxy.h:75
 RooArgProxy.h:76
 RooArgProxy.h:77