16 #ifndef ROO_CATEGORY_PROXY
17 #define ROO_CATEGORY_PROXY
23 class RooCategoryProxy :
public RooArgProxy {
30 RooCategoryProxy(
const char* name,
const char* desc, RooAbsArg* owner,
31 Bool_t valueServer=kTRUE, Bool_t shapeServer=kFALSE, Bool_t proxyOwnsArg=kFALSE) ;
32 RooCategoryProxy(
const char* name,
const char* desc, RooAbsArg* owner, RooAbsCategory& ref,
33 Bool_t valueServer=kTRUE, Bool_t shapeServer=kFALSE, Bool_t proxyOwnsArg=kFALSE) ;
34 RooCategoryProxy(
const char* name, RooAbsArg* owner,
const RooCategoryProxy& other) ;
35 virtual TObject* Clone(
const char* newName=0)
const {
return new RooCategoryProxy(newName,_owner,*
this); }
36 virtual ~RooCategoryProxy();
39 inline operator Int_t()
const {
41 return ((RooAbsCategory*)_arg)->getIndex() ;
43 inline const char* label()
const {
45 return ((RooAbsCategory*)_arg)->getLabel() ;
47 inline const RooAbsCategory& arg()
const {
49 return (RooAbsCategory&)*_arg ;
51 inline Bool_t hasRange(
const char* rangeName)
const {
53 return arg().hasRange(rangeName) ;
57 virtual Bool_t setArg(RooAbsCategory& newRef) ;
61 RooAbsCategoryLValue* lvptr()
const ;
66 RooCategoryProxy& operator=(Int_t index) {
68 lvptr()->setIndex(index) ;
return *this ;
70 RooCategoryProxy& operator=(
const char* _label) {
72 lvptr()->setLabel(_label) ;
return *this ;
77 ClassDef(RooCategoryProxy,1)