ATLAS Offline Software
Loading...
Searching...
No Matches
ExceptionMsg.h
Go to the documentation of this file.
1#ifndef ROOT_CORE_UTILS__EXCEPTION_MSG_H
2#define ROOT_CORE_UTILS__EXCEPTION_MSG_H
3
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8
9// Please feel free to contact me (krumnack@iastate.edu) for bug
10// reports, feature suggestions, praise and complaints.
11
12
13// This module defines an exception that contains nothing more than an
14// error message. The interface provided in this module is intended
15// for the general user. The module is considered to be in the
16// pre-alpha stage.
17
18
19
20//protect
22
23#include <exception>
24#include <string>
25
26namespace RCU
27{
28 class ExceptionMsg : public std::exception
29 {
30 //
31 // public interface
32 //
33
34 // effects: test the invariant of this object
35 // guarantee: no-fail
36 public:
37 void testInvariant () const;
38
39
40 // effects: create an exception with the given message
41 // guarantee: strong
42 // failures: out of memory II
43 // requires: val_file != 0
44 // requires: val_line != 0
45 // requires: !val_message.empty()
46 public:
47 ExceptionMsg (const char *const val_file, const unsigned val_line,
48 const std::string& val_message);
49
50
51 // effects: destroy this object
52 // guarantee: no-fail
53 public:
54 virtual ~ExceptionMsg () throw ();
55
56
57
58 //
59 // interface inherited from std::exception
60 //
61
62 // returns: the message associated with this exception
63 // guarantee: no-fail
64 public:
65 virtual const char *what () const throw ();
66
67
68
69 //
70 // private interface
71 //
72
74 private:
75 std::string m_message;
76 };
77}
78
79#endif
ExceptionMsg(const char *const val_file, const unsigned val_line, const std::string &val_message)
std::string m_message
description: the actual message
virtual ~ExceptionMsg()
void testInvariant() const
virtual const char * what() const
This module defines a variety of assert style macros.
Definition Assert.cxx:26