OMNeT++ NEDXML  5.4.1
exception.h
Go to the documentation of this file.
1 //==========================================================================
2 // exception.h -
3 //
4 // OMNeT++/OMNEST
5 // Discrete System Simulation in C++
6 //
7 //==========================================================================
8 
9 /*--------------------------------------------------------------*
10  Copyright (C) 2002-2017 Andras Varga
11  Copyright (C) 2006-2017 OpenSim Ltd.
12 
13  This file is distributed WITHOUT ANY WARRANTY. See the file
14  `license' for details on this and other legal matters.
15 *--------------------------------------------------------------*/
16 
17 #ifndef __OMNETPP_NEDXML_EXCEPTION_H
18 #define __OMNETPP_NEDXML_EXCEPTION_H
19 
20 #include <string>
21 #include <exception>
22 #include <stdexcept>
23 #include "nedxmldefs.h"
24 
25 namespace omnetpp {
26 namespace nedxml {
27 
28 class ASTNode;
29 
33 class NEDXML_API NedException : public std::runtime_error
34 {
35  protected:
36  std::string msg;
37 
38  public:
42  NedException(const char *messagefmt,...);
43 
47  NedException(ASTNode *context, const char *messagefmt,...);
48 
52  virtual ~NedException() throw() {}
53 
57  virtual const char *what() const throw() override {return msg.c_str();}
58 };
59 
60 
61 } // namespace nedxml
62 } // namespace omnetpp
63 
64 
65 #endif
66 
#define NEDXML_API
Definition: nedxmldefs.h:31
std::string msg
Definition: exception.h:36
Low-level routines throw an exception instead of calling NedErrorStore->add().
Definition: exception.h:33
Definition: astbuilder.h:25
Definition: astnode.h:75
virtual const char * what() const override
Definition: exception.h:57
virtual ~NedException()
Definition: exception.h:52