Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 09:11:41

0001 // @(#)root/eve7:$Id$
0002 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2018
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 
0013 #ifndef ROOT7_REveTypes
0014 #define ROOT7_REveTypes
0015 
0016 #include "RtypesCore.h"
0017 
0018 #include <string>
0019 #include <ostream>
0020 
0021 typedef ULong_t Pixel_t; // from GuiTypes.h
0022 
0023 class TString;
0024 
0025 namespace ROOT {
0026 class RLogChannel;
0027 namespace Experimental {
0028 typedef unsigned int ElementId_t;
0029 
0030 //==============================================================================
0031 // Exceptions, string functions
0032 //==============================================================================
0033 
0034 bool operator==(const TString &t, const std::string &s);
0035 bool operator==(const std::string &s, const TString &t);
0036 
0037 ////////////////////////////////////////////////////////////////////////////////
0038 /// REveException
0039 /// Exception-type thrown by Eve classes.
0040 ////////////////////////////////////////////////////////////////////////////////
0041 
0042 class REveException : public std::exception {
0043    std::string fWhat;
0044 public:
0045    REveException() = default;
0046    explicit REveException(std::string_view s) : fWhat(s) {}
0047    ~REveException() noexcept override {}
0048    void append(std::string_view s) { fWhat.append(s); }
0049 
0050    operator const std::string&() const noexcept { return fWhat; }
0051    const std::string &str() const noexcept { return fWhat; }
0052    const char *what() const noexcept override { return fWhat.c_str(); }
0053 };
0054 
0055 REveException operator+(const REveException &s1, const std::string &s2);
0056 REveException operator+(const REveException &s1, const TString &s2);
0057 REveException operator+(const REveException &s1, const char *s2);
0058 REveException operator+(const REveException &s1, ElementId_t x);
0059 
0060 inline std::ostream& operator <<(std::ostream &s, const REveException &e)
0061 { s << e.what(); return s; }
0062 
0063 /// Log channel for Eve diagnostics.
0064 ROOT::RLogChannel &REveLog();
0065 
0066 } // namespace Experimental
0067 } // namespace ROOT
0068 
0069 #endif