Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TCut.h
Go to the documentation of this file.
1// @(#)root/tree:$Id$
2// Author: Rene Brun 14/04/97
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TCut
13#define ROOT_TCut
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// TCut //
18// //
19// A specialized string object used in TTree selections. //
20// //
21//////////////////////////////////////////////////////////////////////////
22
23#include "TNamed.h"
24
25class TCut : public TNamed {
26private:
27 // Prevent meaningless operator (which otherwise can be reached via
28 // the conversion to 'const char*'
29 Bool_t operator<(const TCut &rhs); // Intentional left unimplemented
30 Bool_t operator<=(const TCut &rhs); // Intentional left unimplemented
31 Bool_t operator>(const TCut &rhs); // Intentional left unimplemented
32 Bool_t operator>=(const TCut &rhs); // Intentional left unimplemented
33public:
34 TCut();
35 TCut(const char *title);
36 TCut(const char *name, const char *title);
37 TCut(const TCut &cut);
38 virtual ~TCut();
39
40 // Assignment
41 TCut& operator=(const char *rhs);
42 TCut& operator=(const TCut &rhs);
43 TCut& operator+=(const char *rhs);
44 TCut& operator+=(const TCut &rhs);
45 TCut& operator*=(const char *rhs);
46 TCut& operator*=(const TCut &rhs);
47
48 // Comparison
49 Bool_t operator==(const char *rhs) const;
50 Bool_t operator==(const TCut &rhs) const;
51 Bool_t operator!=(const char *rhs) const;
52 Bool_t operator!=(const TCut &rhs) const;
53
54 friend TCut operator+(const TCut &lhs, const char *rhs);
55 friend TCut operator+(const char *lhs, const TCut &rhs);
56 friend TCut operator+(const TCut &lhs, const TCut &rhs);
57 friend TCut operator*(const TCut &lhs, const char *rhs);
58 friend TCut operator*(const char *lhs, const TCut &rhs);
59 friend TCut operator*(const TCut &lhs, const TCut &rhs);
60// Preventing warnings with -Weffc++ in GCC since the overloading of the && and || operators was a design choice.
61#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
62#pragma GCC diagnostic push
63#pragma GCC diagnostic ignored "-Weffc++"
64#endif
65 friend TCut operator&&(const TCut &lhs, const char *rhs);
66 friend TCut operator&&(const char *lhs, const TCut &rhs);
67 friend TCut operator&&(const TCut &lhs, const TCut &rhs);
68 friend TCut operator||(const TCut &lhs, const char *rhs);
69 friend TCut operator||(const char *lhs, const TCut &rhs);
70 friend TCut operator||(const TCut &lhs, const TCut &rhs);
71#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
72#pragma GCC diagnostic pop
73#endif
74 friend TCut operator!(const TCut &rhs);
75
76 // Type conversion
77 operator const char*() const { return GetTitle(); }
78
79 ClassDef(TCut,1) //A specialized string object used for TTree selections
80};
81
82// Declarations.
83TCut operator+(const TCut &lhs, const char *rhs);
84TCut operator+(const char *lhs, const TCut &rhs);
85TCut operator+(const TCut &lhs, const TCut &rhs);
86TCut operator*(const TCut &lhs, const char *rhs);
87TCut operator*(const char *lhs, const TCut &rhs);
88TCut operator*(const TCut &lhs, const TCut &rhs);
89// Preventing warnings with -Weffc++ in GCC since the overloading of the && and || operators was a design choice.
90#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
91#pragma GCC diagnostic push
92#pragma GCC diagnostic ignored "-Weffc++"
93#endif
94TCut operator&&(const TCut &lhs, const char *rhs);
95TCut operator&&(const char *lhs, const TCut &rhs);
96TCut operator&&(const TCut &lhs, const TCut &rhs);
97TCut operator||(const TCut &lhs, const char *rhs);
98TCut operator||(const char *lhs, const TCut &rhs);
99TCut operator||(const TCut &lhs, const TCut &rhs);
100#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
101#pragma GCC diagnostic pop
102#endif
103TCut operator!(const TCut &rhs);
104
105#endif
#define ClassDef(name, id)
Definition Rtypes.h:325
TCut operator*(const TCut &lhs, const char *rhs)
Multiplication.
Definition TCut.cxx:208
TCut operator!(const TCut &rhs)
Logical negation.
Definition TCut.cxx:292
TCut operator+(const TCut &lhs, const char *rhs)
Addition.
Definition TCut.cxx:184
TCut operator||(const TCut &lhs, const char *rhs)
Logical or.
Definition TCut.cxx:256
TCut operator&&(const TCut &lhs, const char *rhs)
Logical and.
Definition TCut.cxx:232
char name[80]
Definition TGX11.cxx:110
A specialized string object used for TTree selections.
Definition TCut.h:25
Bool_t operator<(const TCut &rhs)
TCut()
Constructor.
Definition TCut.cxx:47
Bool_t operator>=(const TCut &rhs)
virtual ~TCut()
Typical destructor.
Definition TCut.cxx:75
friend TCut operator*(const TCut &lhs, const char *rhs)
Multiplication.
Definition TCut.cxx:208
friend TCut operator!(const TCut &rhs)
Logical negation.
Definition TCut.cxx:292
friend TCut operator+(const TCut &lhs, const char *rhs)
Addition.
Definition TCut.cxx:184
Bool_t operator<=(const TCut &rhs)
friend TCut operator||(const TCut &lhs, const char *rhs)
Logical or.
Definition TCut.cxx:256
TCut & operator*=(const char *rhs)
Multiplication.
Definition TCut.cxx:158
TCut & operator=(const char *rhs)
Assignment.
Definition TCut.cxx:114
TCut & operator+=(const char *rhs)
Addition.
Definition TCut.cxx:132
Bool_t operator!=(const char *rhs) const
Comparison.
Definition TCut.cxx:98
friend TCut operator&&(const TCut &lhs, const char *rhs)
Logical and.
Definition TCut.cxx:232
Bool_t operator>(const TCut &rhs)
Bool_t operator==(const char *rhs) const
Comparison.
Definition TCut.cxx:82
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
virtual const char * GetTitle() const
Returns title of object.
Definition TNamed.h:48