ATLAS Offline Software
ExceptionMsg.cxx
Go to the documentation of this file.
1 //
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Please feel free to contact me (krumnack@iastate.edu) for bug
7 // reports, feature suggestions, praise and complaints.
8 
9 
10 //
11 // includes
12 //
13 
14 //protect
16 
17 #include <memory>
18 #include <RootCoreUtils/Assert.h>
19 
20 //
21 // method implementations
22 //
23 
24 namespace RCU
25 {
27  testInvariant () const
28  {
29  //RCU_INVARIANT (this != 0);
30  RCU_INVARIANT (!m_message.empty());
31  }
32 
33 
34 
36  ExceptionMsg (const char *const /*val_file*/, const unsigned /*val_line*/,
37  const std::string& val_message)
38  : m_message (val_message)
39  {
40  RCU_NEW_INVARIANT (this);
41  }
42 
43 
44 
46  ~ExceptionMsg () throw ()
47  {
48  RCU_DESTROY_INVARIANT (this);
49  }
50 
51 
52 
53  const char *ExceptionMsg ::
54  what () const throw ()
55  {
56  RCU_READ_INVARIANT (this);
57  return m_message.c_str();
58  }
59 }
ExceptionMsg.h
RCU
This module defines a variety of assert style macros.
Definition: Assert.cxx:26
Assert.h
RCU::ExceptionMsg::what
virtual const char * what() const
Definition: ExceptionMsg.cxx:54
RCU::ExceptionMsg::ExceptionMsg
ExceptionMsg(const char *const val_file, const unsigned val_line, const std::string &val_message)
Definition: ExceptionMsg.cxx:36
RCU_INVARIANT
#define RCU_INVARIANT(x)
Definition: Assert.h:201
RCU::ExceptionMsg::~ExceptionMsg
virtual ~ExceptionMsg()
Definition: ExceptionMsg.cxx:46
RCU::ExceptionMsg::m_message
std::string m_message
description: the actual message
Definition: ExceptionMsg.h:75
RCU_DESTROY_INVARIANT
#define RCU_DESTROY_INVARIANT(x)
Definition: Assert.h:235
RCU::ExceptionMsg::testInvariant
void testInvariant() const
Definition: ExceptionMsg.cxx:27
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
RCU_NEW_INVARIANT
#define RCU_NEW_INVARIANT(x)
Definition: Assert.h:233