22 class RooCatType :
public TObject,
public RooPrintable {
24 inline RooCatType() : TObject(), RooPrintable() {
26 _value = 0 ; _label[0] = 0 ;
29 inline RooCatType(
const char* name, Int_t value) : TObject(), RooPrintable(), _value(value) {
33 inline RooCatType(
const RooCatType& other) :
34 TObject(other), RooPrintable(other), _value(other._value) {
36 strlcpy(_label,other._label,256) ;
39 virtual ~RooCatType() {
42 virtual TObject* Clone(
const char*)
const {
return new RooCatType(*
this); }
44 virtual const Text_t* GetName()
const {
46 return _label[0] ? _label : 0 ;
48 void SetName(
const Text_t* name) ;
50 inline RooCatType& operator=(
const RooCatType& other) {
52 if (&other==
this)
return *this ;
55 _value = other._value ;
58 inline void assignFast(
const RooCatType& other) {
61 _value = other._value ;
64 inline Bool_t operator==(
const RooCatType& other)
const {
66 return (_value==other._value) ;
69 inline Bool_t operator==(Int_t index)
const {
71 return (_value==index) ;
74 Bool_t operator==(
const char* label)
const {
76 return label && !strcmp(_label,label) ;
79 inline Int_t getVal()
const {
83 void setVal(Int_t newValue) {
88 virtual void printName(std::ostream& os)
const ;
89 virtual void printTitle(std::ostream& os)
const ;
90 virtual void printClassName(std::ostream& os)
const ;
91 virtual void printValue(std::ostream& os)
const ;
93 inline virtual void Print(Option_t *options= 0)
const {
95 printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
100 friend class RooAbsCategoryLValue ;
101 friend class RooAbsCategory ;
105 ClassDef(RooCatType,1)