Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : break forgotten in switch
[simgrid.git] / src / cxx / Exception.cxx
1 /*
2  * Exception.cxx
3  *
4  * Copyright 2006,2007 Martin Quinson, Malek Cherier           
5  * All right reserved. 
6  *
7  * This program is free software; you can redistribute 
8  * it and/or modify it under the terms of the license 
9  *(GNU LGPL) which comes with this package. 
10  *
11  */
12  
13  /* Exception member functions implementation.
14   * The base class of all the types of exceptions of SimGrid::Msg.
15   */  
16
17 #include <Exception.hpp>
18
19 namespace SimGrid
20 {
21         namespace Msg
22         {
23                 
24                         Exception::Exception()
25                         {
26                                 reason = "Unknown reason";
27                         }
28                 
29                 
30                         Exception::Exception(const Exception& rException)
31                         {
32                                 this->reason = rException.toString();
33                         }
34                 
35                 
36                         Exception::Exception(const char* reason)
37                         {
38                                 this->reason = reason;
39                         }
40                 
41                 
42                         Exception::~Exception()
43                         {
44                                 // NOTHING TODO
45                         }
46                                 
47                         const char* Exception::toString(void) const
48                         {
49                                 return this->reason;    
50                         }
51                 
52                 
53                         const Exception& Exception::operator = (const Exception& rException)
54                         {
55                                 this->reason = rException.toString();
56                                 return *this;
57                         }
58                 
59         } // namespace Msg      
60
61 }// namespace SimGrid
62
63
64