TCut.h

Go to the documentation of this file.
00001 // @(#)root/tree:$Id: TCut.h 34744 2010-08-07 06:16:36Z brun $
00002 // Author: Rene Brun   14/04/97
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TCut
00013 #define ROOT_TCut
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // TCut                                                                 //
00018 //                                                                      //
00019 // A specialized string object used in TTree selections.                //
00020 //                                                                      //
00021 //////////////////////////////////////////////////////////////////////////
00022 
00023 #ifndef ROOT_TNamed
00024 #include "TNamed.h"
00025 #endif
00026 
00027 class TCut : public TNamed {
00028 private:
00029    // Prevent meaningless operator (which otherwise can be reached via
00030    // the conversion to 'const char*'
00031    Bool_t operator<(const TCut &rhs); // Intentional left unimplemented
00032    Bool_t operator<=(const TCut &rhs); // Intentional left unimplemented
00033    Bool_t operator>(const TCut &rhs); // Intentional left unimplemented
00034    Bool_t operator>=(const TCut &rhs); // Intentional left unimplemented
00035 public:
00036    TCut();
00037    TCut(const char *title);
00038    TCut(const char *name, const char *title);
00039    TCut(const TCut &cut);
00040    virtual ~TCut();
00041 
00042    // Assignment
00043    TCut&    operator=(const char *rhs);
00044    TCut&    operator=(const TCut &rhs);
00045    TCut&    operator+=(const char *rhs);
00046    TCut&    operator+=(const TCut &rhs);
00047    TCut&    operator*=(const char *rhs);
00048    TCut&    operator*=(const TCut &rhs);
00049    
00050    // Comparison
00051    Bool_t   operator==(const char *rhs) const;
00052    Bool_t   operator==(const TCut &rhs) const;
00053    Bool_t   operator!=(const char *rhs) const;
00054    Bool_t   operator!=(const TCut &rhs) const;
00055    
00056    friend TCut operator+(const TCut &lhs, const char *rhs);
00057    friend TCut operator+(const char *lhs, const TCut &rhs);
00058    friend TCut operator+(const TCut &lhs, const TCut &rhs);
00059    friend TCut operator*(const TCut &lhs, const char *rhs);
00060    friend TCut operator*(const char *lhs, const TCut &rhs);
00061    friend TCut operator*(const TCut &lhs, const TCut &rhs);
00062 // Preventing warnings with -Weffc++ in GCC since the overloading of the && and || operators was a design choice.
00063 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
00064 #pragma GCC diagnostic push
00065 #pragma GCC diagnostic ignored "-Weffc++"
00066 #endif
00067    friend TCut operator&&(const TCut &lhs, const char *rhs);
00068    friend TCut operator&&(const char *lhs, const TCut &rhs);
00069    friend TCut operator&&(const TCut &lhs, const TCut &rhs);
00070    friend TCut operator||(const TCut &lhs, const char *rhs);
00071    friend TCut operator||(const char *lhs, const TCut &rhs);
00072    friend TCut operator||(const TCut &lhs, const TCut &rhs);
00073 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
00074 #pragma GCC diagnostic pop
00075 #endif
00076    friend TCut operator!(const TCut &rhs);
00077 
00078    // Type conversion
00079    operator const char*() const { return GetTitle(); }
00080 
00081    ClassDef(TCut,1)  //A specialized string object used for TTree selections
00082 };
00083 
00084 #endif

Generated on Tue Jul 5 14:26:42 2011 for ROOT_528-00b_version by  doxygen 1.5.1