Logo AND Algorithmique Numérique Distribuée

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