Logo ROOT  
Reference Guide
RooInt.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooInt.h,v 1.6 2007/05/11 09:11:30 verkerke 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_INT
17#define ROO_INT
18
19#include "Rtypes.h"
20#include "TNamed.h"
21
22class RooInt : public TNamed {
23public:
24
25 RooInt() : _value(0) {} ;
26 RooInt(Int_t value) : TNamed(), _value(value) {} ;
27 RooInt(const RooInt& other) : TNamed(other), _value(other._value) {}
28 virtual ~RooInt() {} ;
29
30 // Double_t cast operator
31 inline operator Int_t() const { return _value ; }
32 RooInt& operator=(Int_t value) { _value = value ; return *this ; }
33
34 // Sorting interface ;
35 Int_t Compare(const TObject* other) const ;
36 virtual Bool_t IsSortable() const { return kTRUE ; }
37
38protected:
39
40 Int_t _value ; // Payload
41 ClassDef(RooInt,1) // Container class for Int_t
42};
43
44#endif
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
RooInt is a minimal implementation of a TObject holding a Int_t value.
Definition: RooInt.h:22
RooInt & operator=(Int_t value)
Definition: RooInt.h:32
virtual Bool_t IsSortable() const
Definition: RooInt.h:36
RooInt()
Definition: RooInt.h:25
RooInt(const RooInt &other)
Definition: RooInt.h:27
virtual ~RooInt()
Definition: RooInt.h:28
Int_t _value
Definition: RooInt.h:40
Int_t Compare(const TObject *other) const
Facilitate sorting of RooInts in ROOT container classes Return -1 or +1 if 'other' is a RooInt with v...
Definition: RooInt.cxx:44
RooInt(Int_t value)
Definition: RooInt.h:26
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37