Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
REveTypes.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, 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 
13 #ifndef ROOT7_REveTypes
14 #define ROOT7_REveTypes
15 
16 #include "GuiTypes.h" // For Pixel_t only, to be changed.
17 
18 #include "TString.h"
19 
20 class TGeoManager;
21 
22 namespace ROOT {
23 namespace Experimental {
24 
25 typedef unsigned int ElementId_t;
26 
27 
28 //==============================================================================
29 // Exceptions, string functions
30 //==============================================================================
31 
32 bool operator==(const TString &t, const std::string &s);
33 bool operator==(const std::string &s, const TString &t);
34 
35 ////////////////////////////////////////////////////////////////////////////////
36 /// REveException
37 /// Exception-type thrown by Eve classes.
38 ////////////////////////////////////////////////////////////////////////////////
39 
40 class REveException : public std::exception {
41  std::string fWhat;
42 public:
43  REveException() = default;
44  explicit REveException(const std::string &s) : fWhat(s) {}
45  virtual ~REveException() noexcept {}
46  void append(const std::string &s) { fWhat.append(s); }
47 
48  const char *what() const noexcept override { return fWhat.c_str(); }
49 };
50 
51 REveException operator+(const REveException &s1, const std::string &s2);
52 REveException operator+(const REveException &s1, const TString &s2);
53 REveException operator+(const REveException &s1, const char *s2);
54 REveException operator+(const REveException &s1, ElementId_t x);
55 
56 } // namespace Experimental
57 } // namespace ROOT
58 
59 #endif