Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] merging instr_variables.c into instr_interface.c (code re-organization)
[simgrid.git] / src / cxx / OutOfBoundsException.cxx
index 3fb9412..fe2570e 100644 (file)
@@ -1,81 +1,81 @@
-/*\r
- * OutOfBoundsException.cxx\r
- *\r
- * Copyright 2006,2007 Martin Quinson, Malek Cherier           \r
- * All right reserved. \r
- *\r
- * This program is free software; you can redistribute \r
- * it and/or modify it under the terms of the license \r
- *(GNU LGPL) which comes with this package. \r
- *\r
- */\r
\r
- /* OutOfBoundsException member functions implementation.\r
-  */  \r
-\r
-#include <OutOfBoundsException.hpp>\r
-\r
-#include <string.h>\r
-#include <stdlib.h>\r
-#include <stdio.h>\r
-\r
-\r
-namespace SimGrid\r
-{\r
-       namespace Msg\r
-       {\r
-               \r
-                       OutOfBoundsException::OutOfBoundsException()\r
-                       {\r
-                               this->reason = (char*) calloc(strlen("Out of bounds") + 1, sizeof(char));\r
-                               strcpy(this->reason, "Out of bounds");\r
-                       }\r
-               \r
-               \r
-                       OutOfBoundsException::OutOfBoundsException(const OutOfBoundsException& rOutOfBoundsException)\r
-                       {\r
-                               const char* reason = rOutOfBoundsException.toString();\r
-                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
-                               strcpy(this->reason, reason);\r
-                               \r
-                       }\r
-               \r
-                       OutOfBoundsException::OutOfBoundsException(int pos)\r
-                       {\r
-                               this->reason = (char*) calloc(strlen("Out of bounds ") + 21 + 1, sizeof(char));\r
-                               sprintf(this->reason, "Out of bounds %d", pos);\r
-                       }\r
-\r
-                       OutOfBoundsException::OutOfBoundsException(int pos1, int pos2)\r
-                       {\r
-                               this->reason = (char*) calloc(strlen("Out of bounds ") + (2*21) + 1, sizeof(char));\r
-                               sprintf(this->reason, "Out of bounds %d : %d", pos1, pos2);\r
-                       }\r
-               \r
-               \r
-                       OutOfBoundsException::~OutOfBoundsException()\r
-                       {\r
-                               if(this->reason)\r
-                                       free(this->reason);\r
-                       }\r
-                               \r
-                       const char* OutOfBoundsException::toString(void) const\r
-                       {\r
-                               return (const char*)(this->reason);     \r
-                       }\r
-               \r
-               \r
-                       const OutOfBoundsException& OutOfBoundsException::operator = (const OutOfBoundsException& rOutOfBoundsException)\r
-                       {\r
-                               const char* reason = rOutOfBoundsException.toString();\r
-                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));\r
-                               \r
-                               return *this;\r
-                       }\r
-               \r
-       } // namespace Msg      \r
-\r
-}// namespace SimGrid\r
-\r
-\r
-\r
+/*
+ * OutOfBoundsException.cxx
+ *
+ * Copyright 2006,2007 Martin Quinson, Malek Cherier           
+ * All right reserved. 
+ *
+ * This program is free software; you can redistribute 
+ * it and/or modify it under the terms of the license 
+ *(GNU LGPL) which comes with this package. 
+ *
+ */
+ /* OutOfBoundsException member functions implementation.
+  */  
+
+#include <OutOfBoundsException.hpp>
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+
+namespace SimGrid
+{
+       namespace Msg
+       {
+               
+                       OutOfBoundsException::OutOfBoundsException()
+                       {
+                               this->reason = (char*) calloc(strlen("Out of bounds") + 1, sizeof(char));
+                               strcpy(this->reason, "Out of bounds");
+                       }
+               
+               
+                       OutOfBoundsException::OutOfBoundsException(const OutOfBoundsException& rOutOfBoundsException)
+                       {
+                               const char* reason = rOutOfBoundsException.toString();
+                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
+                               strcpy(this->reason, reason);
+                               
+                       }
+               
+                       OutOfBoundsException::OutOfBoundsException(int pos)
+                       {
+                               this->reason = (char*) calloc(strlen("Out of bounds ") + 21 + 1, sizeof(char));
+                               sprintf(this->reason, "Out of bounds %d", pos);
+                       }
+
+                       OutOfBoundsException::OutOfBoundsException(int pos1, int pos2)
+                       {
+                               this->reason = (char*) calloc(strlen("Out of bounds ") + (2*21) + 1, sizeof(char));
+                               sprintf(this->reason, "Out of bounds %d : %d", pos1, pos2);
+                       }
+               
+               
+                       OutOfBoundsException::~OutOfBoundsException()
+                       {
+                               if(this->reason)
+                                       free(this->reason);
+                       }
+                               
+                       const char* OutOfBoundsException::toString(void) const
+                       {
+                               return (const char*)(this->reason);     
+                       }
+               
+               
+                       const OutOfBoundsException& OutOfBoundsException::operator = (const OutOfBoundsException& rOutOfBoundsException)
+                       {
+                               const char* reason = rOutOfBoundsException.toString();
+                               this->reason = (char*) calloc(strlen(reason) + 1, sizeof(char));
+                               
+                               return *this;
+                       }
+               
+       } // namespace Msg      
+
+}// namespace SimGrid
+
+
+