ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooRealProxy.h,v 1.23 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_REAL_PROXY
#define ROO_REAL_PROXY

#include "RooAbsReal.h"
#include "RooArgProxy.h"
#include "RooAbsRealLValue.h"

class RooRealProxy : public RooArgProxy {
public:

  // Constructors, assignment etc.
  RooRealProxy() {} ;
  RooRealProxy(const char* name, const char* desc, RooAbsArg* owner,
	       Bool_t valueServer=kTRUE, Bool_t shapeServer=kFALSE, Bool_t proxyOwnsArg=kFALSE) ;
  RooRealProxy(const char* name, const char* desc, RooAbsArg* owner, RooAbsReal& ref,
	       Bool_t valueServer=kTRUE, Bool_t shapeServer=kFALSE, Bool_t proxyOwnsArg=kFALSE) ;
  RooRealProxy(const char* name, RooAbsArg* owner, const RooRealProxy& other) ;
  virtual TObject* Clone(const char* newName=0) const { return new RooRealProxy(newName,_owner,*this); }
  virtual ~RooRealProxy();

  // Accessors
#ifndef _WIN32
  inline operator Double_t() const { return (_arg->_fast && !_arg->_inhibitDirty) ? ((RooAbsReal*)_arg)->_value : ((RooAbsReal*)_arg)->getVal(_nset) ; }
#else
  inline operator Double_t() const { return (_arg->_fast && !_arg->inhibitDirty()) ? ((RooAbsReal*)_arg)->_value : ((RooAbsReal*)_arg)->getVal(_nset) ; }
#endif

  inline const RooAbsReal& arg() const { return (RooAbsReal&)*_arg ; }

  // Modifier
  virtual Bool_t setArg(RooAbsReal& newRef) ;

protected:

  RooAbsRealLValue* lvptr() const ;

public:

  // LValue operations 
  RooRealProxy& operator=(const Double_t& value) { lvptr()->setVal(value) ; return *this ; }
  Double_t min(const char* rname=0) const { return lvptr()->getMin(rname) ; }
  Double_t max(const char* rname=0) const { return lvptr()->getMax(rname) ; }
  Bool_t hasMin(const char* rname=0) const { return lvptr()->hasMin(rname) ; }
  Bool_t hasMax(const char* rname=0) const { return lvptr()->hasMax(rname) ; }


  ClassDef(RooRealProxy,1) // Proxy for a RooAbsReal object
};

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