ATLAS Offline Software
Loading...
Searching...
No Matches
ExceptionMsg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#ifndef ROOT_CORE_UTILS__EXCEPTION_MSG_H
8#define ROOT_CORE_UTILS__EXCEPTION_MSG_H
9
10// This module defines an exception that contains nothing more than an
11// error message.
12
13
14
15//protect
17
18#include <exception>
19#include <string>
20
21namespace RCU
22{
23 class ExceptionMsg : public std::exception
24 {
25 //
26 // public interface
27 //
28
29 // effects: test the invariant of this object
30 // guarantee: no-fail
31 public:
32 void testInvariant () const;
33
34
35 // effects: create an exception with the given message
36 // guarantee: strong
37 // failures: out of memory II
38 // requires: val_file != 0
39 // requires: val_line != 0
40 // requires: !val_message.empty()
41 public:
42 ExceptionMsg (const char *const val_file, const unsigned val_line,
43 const std::string& val_message);
44
45
46 // effects: destroy this object
47 // guarantee: no-fail
48 public:
49 virtual ~ExceptionMsg () throw ();
50
51
52
53 //
54 // interface inherited from std::exception
55 //
56
57 // returns: the message associated with this exception
58 // guarantee: no-fail
59 public:
60 virtual const char *what () const throw ();
61
62
63
64 //
65 // private interface
66 //
67
69 private:
70 std::string m_message;
71 };
72}
73
74#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:23