ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIException.h
Go to the documentation of this file.
1 
11 #ifndef _GUISTOCKEXCEPT_H_
12 #define _GUISTOCKEXCEPT_H_
13 
14 #include<string>
15 #include<stdexcept>
16 // just for std::cout
17 #include<iostream>
18 
19 // all cases need FileError
20 #include "../src_cpp/StockException.h"
21 
30 class GUIException : public std::exception
31 {
32  public:
33  GUIException() : std::exception() {}
34  GUIException( const std::string & mMsg );
35  // necessary for g++ 4.6, not 4.7, for base class only
36  ~GUIException() throw() {}
37  virtual const char * what() const noexcept {
38  // always the base class is called
39  return mGUIMsg.c_str();
40  }
41  protected :
42  std::string mGUIMsg;
43 };
44 
49 class GUIStockException : public virtual GUIException, public virtual StockException
50 {
51  public:
53  GUIStockException( const StockException & fError ) :
55 #ifdef DEBUG_EXCEPT
56  std::cout << "Constructor GUIStockException with StockException argument " << std::endl;
57 #endif
58  mGUIMsg = "GUIStockException: \n" + fError.GetMessage();
59  }
60  // follow same logic
61  /*
62  virtual const char * what() const noexcept {
63  return GUIException::what();
64  }*/
65 
66 };
67 
68 #endif // _GUISTOCKEXCEPT_H_
virtual const char * what() const noexcept
Definition: GUIException.h:37
Base Exception for Stock and StockManager, all src_cpp code.
GUIStockException(const StockException &fError)
Definition: GUIException.h:53
Base class, for all gui errors Need a real base class here, or just use directly StockException.
Definition: GUIException.h:49
std::string GetMessage() const
allow GUIException to get the message
std::string mGUIMsg
Definition: GUIException.h:42