Remove dynamic exceptions
[anna.git] / source / core / DataBlock.cpp
index 38700a2..4d69d59 100644 (file)
@@ -20,7 +20,7 @@ using namespace anna;
    if ((a_size + (a)) >= a_maxSize) extend ((a));
 
 DataBlock::DataBlock(const char* buffer, const int size, const bool deepCopy)
-throw(RuntimeException) :
+noexcept(false) :
   a_buffer(NULL),
   a_size(0),
   a_deepCopy(deepCopy),
@@ -29,7 +29,7 @@ throw(RuntimeException) :
 }
 
 DataBlock::DataBlock(const DataBlock& other)
-throw(RuntimeException) :
+noexcept(false) :
   a_buffer(NULL),
   a_size(0),
   a_deepCopy(other.a_deepCopy),
@@ -43,7 +43,7 @@ DataBlock::~DataBlock() {
 }
 
 void DataBlock::initialize(const char* buffer, const int size)
-throw(RuntimeException) {
+noexcept(false) {
   if(a_deepCopy == false) {
     a_buffer = const_cast <char*>(buffer);
     a_size = size;
@@ -59,7 +59,7 @@ throw(RuntimeException) {
 }
 
 void DataBlock::setSize(const int size)
-throw(RuntimeException) {
+noexcept(false) {
 //   if (size > a_maxSize) {
 //      string msg ("DataBlock::setSize | MaxSize: ");
 //      msg += functions::asString (a_maxSize);
@@ -79,7 +79,7 @@ throw(RuntimeException) {
 }
 
 void DataBlock::allocate(const int nbytes)
-throw(RuntimeException) {
+noexcept(false) {
   if(nbytes > a_size) {
     if(a_maxSize == 0) {
       if(a_deepCopy == false)
@@ -95,7 +95,7 @@ throw(RuntimeException) {
 }
 
 void DataBlock::assign(const char* buffer, const int size)
-throw(RuntimeException) {
+noexcept(false) {
   if(a_deepCopy == false) {
     a_buffer = const_cast <char*>(buffer);
     a_size = size;
@@ -107,7 +107,7 @@ throw(RuntimeException) {
 }
 
 DataBlock& DataBlock::operator = (const DataBlock & right)
-throw(RuntimeException) {
+noexcept(false) {
   if(this != &right) {
     if(a_deepCopy) {
       a_size = 0;
@@ -122,7 +122,7 @@ throw(RuntimeException) {
 }
 
 const char DataBlock::operator [](const int pos) const
-throw(RuntimeException) {
+noexcept(false) {
   if(pos >= a_size) {
     std::string msg("Position: ");
     msg += functions::asString(pos);
@@ -136,7 +136,7 @@ throw(RuntimeException) {
 }
 
 char& DataBlock::operator [](const int pos)
-throw(RuntimeException) {
+noexcept(false) {
   if(pos >= a_size) {
     std::string msg("Position: ");
     msg += functions::asString(pos);
@@ -151,7 +151,7 @@ throw(RuntimeException) {
 }
 
 void DataBlock::append(const char* data, const int len)
-throw(RuntimeException) {
+noexcept(false) {
   if(a_buffer == data && data != NULL && len > 0)
     throw RuntimeException("Can not append myself", ANNA_FILE_LOCATION);
 
@@ -170,7 +170,7 @@ throw(RuntimeException) {
 }
 
 void DataBlock::remove(const int pos, const int nbytes)
-throw(RuntimeException) {
+noexcept(false) {
   if(a_deepCopy == false)
     throw RuntimeException("Deep copy not activated", ANNA_FILE_LOCATION);
 
@@ -189,7 +189,7 @@ throw(RuntimeException) {
 }
 
 void DataBlock::remove(const int nbytes)
-throw(RuntimeException) {
+noexcept(false) {
   if(a_deepCopy == false)
     throw RuntimeException("Deep copy not activated", ANNA_FILE_LOCATION);
 
@@ -208,7 +208,7 @@ throw(RuntimeException) {
 }
 
 void DataBlock::extend(const int nbytes)
-throw(RuntimeException) {
+noexcept(false) {
   if(a_deepCopy == false)
     throw RuntimeException("Deep copy not activated", ANNA_FILE_LOCATION);
 
@@ -230,7 +230,7 @@ throw(RuntimeException) {
 }
 
 std::string DataBlock::asString(const int characterByLine) const
-throw() {
+{
   char aux [16];
   std::string numbers;
   std::string characters;