Remove dynamic exceptions
[anna.git] / include / anna / comm / CompatCodec.hpp
index f6e45c8..cb16838 100644 (file)
@@ -90,7 +90,7 @@ namespace comm {
 */
 class CompatCodec : public Message {
   struct SortById {
-    static short int value(const comm::Variable* variable) throw() {
+    static short int value(const comm::Variable* variable) {
       return variable->getId();
     }
   };
@@ -104,21 +104,21 @@ class CompatCodec : public Message {
 
     VariableContainer();
 
-    void clear() throw();
-    void add(comm::Variable* variable) throw();
-    comm::Variable* find(const int id) throw();
-    const comm::Variable* find(const int id) const throw();
+    void clear() ;
+    void add(comm::Variable* variable) ;
+    comm::Variable* find(const int id) ;
+    const comm::Variable* find(const int id) const ;
 
-    int size() const throw() { return a_size; }
+    int size() const { return a_size; }
 
-    iterator begin() throw() { return a_variables; }
-    iterator end() throw() { return a_variables + a_size; }
+    iterator begin() { return a_variables; }
+    iterator end() { return a_variables + a_size; }
 
-    const_iterator begin() const throw() { return a_variables; }
-    const_iterator end() const throw() { return a_variables + a_size; }
+    const_iterator begin() const { return a_variables; }
+    const_iterator end() const { return a_variables + a_size; }
 
-    static comm::Variable* data(iterator ii) throw() { return *ii; }
-    static const comm::Variable* data(const_iterator ii) throw() { return *ii; }
+    static comm::Variable* data(iterator ii) { return *ii; }
+    static const comm::Variable* data(const_iterator ii) { return *ii; }
 
   private:
     comm::Variable** a_variables;
@@ -154,7 +154,7 @@ public:
      Devuelve el identificador del mensaje indicado en el constructor.
     @return El identificador de este mensaje.
   */
-  Type getType() const throw() { return a_type; }
+  Type getType() const { return a_type; }
 
 // Metodos
   /**
@@ -169,7 +169,7 @@ public:
      al mensaje y viceversa.
      @return Un puntero que hace referencia al nuevo dato interno que ha sido creado.
   */
-  const Variable* attach(const char* name, const short int id, std::string& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, std::string& value) noexcept(false);
 
   /**
      Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase
@@ -183,7 +183,7 @@ public:
      al mensaje y viceversa.
      @return Un puntero que hace referencia al nuevo dato interno que ha sido creado.
   */
-  const Variable* attach(const char* name, const short int id, const char*& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, const char*& value) noexcept(false);
 
   /**
      Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase
@@ -197,7 +197,7 @@ public:
      al mensaje y viceversa.
      @return Un puntero que hace referencia al nuevo dato interno que ha sido creado.
   */
-  const Variable* attach(const char* name, const short int id, int& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, int& value) noexcept(false);
 
   /**
      Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase
@@ -211,7 +211,7 @@ public:
      al mensaje y viceversa.
      @return Un puntero que hace referencia al nuevo dato interno que ha sido creado.
   */
-  const Variable* attach(const char* name, const short int id, S64& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, S64& value) noexcept(false);
 
   /**
      Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase
@@ -225,7 +225,7 @@ public:
      al mensaje y viceversa.
      @return Un puntero que hace referencia al nuevo dato interno que ha sido creado.
   */
-  const Variable* attach(const char* name, const short int id, bool& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, bool& value) noexcept(false);
 
   /**
      Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase
@@ -239,7 +239,7 @@ public:
      al mensaje y viceversa. Debe tener activado el sistema de copia profunda.
      @return Un puntero que hace referencia al nuevo dato interno que ha sido creado.
   */
-  const Variable* attach(const char* name, const short int id, DataBlock& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, DataBlock& value) noexcept(false);
 
   /**
      Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase
@@ -253,7 +253,7 @@ public:
      al mensaje y viceversa. Debe tener activado el sistema de copia profunda.
      @return Un puntero que hace referencia al nuevo dato interno que ha sido creado.
   */
-  const Variable* attach(const char* name, const short int id, float& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, float& value) noexcept(false);
 
   /**
      Asocia el valor recibido como parametro al dato interno identificado por `id'. Esta clase
@@ -267,11 +267,11 @@ public:
      al mensaje y viceversa. Debe tener activado el sistema de copia profunda.
      @return Un puntero que hace referencia al nuevo dato interno que ha sido creado.
   */
-  const Variable* attach(const char* name, const short int id, double& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, double& value) noexcept(false);
 
-  const Variable* attach(const char* name, const short int id, Second& value) throw(RuntimeException);
-  const Variable* attach(const char* name, const short int id, Millisecond& value) throw(RuntimeException);
-  const Variable* attach(const char* name, const short int id, Microsecond& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, Second& value) noexcept(false);
+  const Variable* attach(const char* name, const short int id, Millisecond& value) noexcept(false);
+  const Variable* attach(const char* name, const short int id, Microsecond& value) noexcept(false);
 
   /**
    * Asocia el mensaje recibido como un parámetro interno especificado por \em id.
@@ -279,7 +279,7 @@ public:
    * \param id Identificador del dato asignado.
    * \param value Instancia del mensaje que se codificará/decodificará de forma recursiva.
    */
-  const Variable* attach(const char* name, const short int id, comm::CompatCodec& value) throw(RuntimeException);
+  const Variable* attach(const char* name, const short int id, comm::CompatCodec& value) noexcept(false);
 
   /**
      Devuelve la referencia al dato interno identificado por el `id' recibido como parametro.
@@ -288,7 +288,7 @@ public:
 
      @return La referencia de la variable identificada por 'id'. Si no existe se lanzar�una excepcin.
   */
-  const Variable& find(const short int id) const throw(RuntimeException);
+  const Variable& find(const short int id) const noexcept(false);
 
   /**
      Marca el dato asociado al identificador recibido como nulo, lo cual conlleva que el dato no seria
@@ -297,7 +297,7 @@ public:
      @param id Identificador asignado al dato.
      @param isNull Indica la nueva marca de la variable.
   */
-  void setNull(const short int id, const bool isNull = true) throw(RuntimeException);
+  void setNull(const short int id, const bool isNull = true) noexcept(false);
 
   /**
      Marca el dato recibido como nulo, lo cual conlleva que el dato no seria transferido al bloque
@@ -306,7 +306,7 @@ public:
      @param variable Instancia de Varaible obtenida al invocar al método #attach
      @param isNull Indica la nueva marca de la variable.
   */
-  void setNull(const Variable* variable, const bool isNull = true) throw();
+  void setNull(const Variable* variable, const bool isNull = true) ;
 
   /**
      @param id Identificador asignado al dato.
@@ -316,37 +316,37 @@ public:
      Un dato puede tener un value nulo, bien por que se ha invocado a la funcin @ref setNull
      o bien porque se recibio un mensaje en el que no venia contenido el identificador del dato.
   */
-  bool isNull(const short int id) const throw(RuntimeException);
+  bool isNull(const short int id) const noexcept(false);
 
   /**
      Devuelve un iterador al comienzo de la lista de variables asociados a este mensaje.
      \return Un iterador al comienzo de la lista de variables asociados a este mensaje.
   */
-  iterator begin() throw() { return a_variables.begin(); }
+  iterator begin() { return a_variables.begin(); }
 
   /**
      Devuelve un iterador al comienzo de la lista de variables asociados a este mensaje.
      \return Un iterador al comienzo de la lista de variables asociados a este mensaje.
   */
-  const_iterator begin() const throw() { return a_variables.begin(); }
+  const_iterator begin() const { return a_variables.begin(); }
 
   /**
      Devuelve un iterador al comienzo de la lista de variables asociados a este mensaje.
      \return Un iterador al final de la lista de variables asociados a este mensaje.
   */
-  iterator end() throw() { return a_variables.end(); }
+  iterator end() { return a_variables.end(); }
 
   /**
      Devuelve un iterador al comienzo de la lista de variables asociados a este mensaje.
      \return Un iterador al final de la lista de variables asociados a este mensaje.
   */
-  const_iterator end() const throw() { return a_variables.end(); }
+  const_iterator end() const { return a_variables.end(); }
 
   /**
      Devuelve el número de enginees asociados a.esta instancia.
      \return el número de enginees asociados a.esta instancia.
   */
-  int size() const throw() { return a_variables.size(); }
+  int size() const { return a_variables.size(); }
 
   /**
      Devuelve la instancia de la variable sobre el que esta posicionado el iterador recibido
@@ -354,7 +354,7 @@ public:
      \param ii Iterador que debera estar comprendido entre begin y end.
      \return La instancia de la variable sobre el que esta posicionado el iterador recibido
   */
-  static Variable* variable(iterator ii) throw() { return container::data(ii); }
+  static Variable* variable(iterator ii) { return container::data(ii); }
 
   /**
      Devuelve la instancia de la variable sobre el que esta posicionado el iterador recibido
@@ -362,13 +362,13 @@ public:
      \param ii Iterador que debera estar comprendido entre begin y end.
      \return La instancia de la variable sobre el que esta posicionado el iterador recibido
   */
-  static const Variable* variable(const_iterator ii) throw() { return container::data(ii); }
+  static const Variable* variable(const_iterator ii) { return container::data(ii); }
 
   /**
      Transfiene los datos establecidos en este mensaje interno a un bloque de memoria cuya instancia es devuelta por este metodo.
      @return Bloque de memoria que contiene la informacion del mensaje.
   */
-  virtual const DataBlock& code() throw(RuntimeException);
+  virtual const DataBlock& code() noexcept(false);
 
   /**
      Transfiene la informacion contenida en el bloque de memoria recibido hacia las variables asociadas a este mensaje interno.
@@ -376,7 +376,7 @@ public:
 
      @param dataBlock Bloque de memoria que contiene las variables codificadas.
   */
-  virtual void decode(const DataBlock& dataBlock) throw(RuntimeException);
+  virtual void decode(const DataBlock& dataBlock) noexcept(false);
 
   /**
      Permite conocer el identificador del mensaje que viene contenido en el bloque de memoria
@@ -386,7 +386,7 @@ public:
 
      @return El tipo del mensaje contenido en el bloque de memoria.
   */
-  static Type getType(const DataBlock& dataBlock) throw(RuntimeException);
+  static Type getType(const DataBlock& dataBlock) noexcept(false);
 
 protected:
   bool a_scramble;
@@ -401,8 +401,8 @@ private:
   CompatCodec(const CompatCodec&);
   CompatCodec& operator = (const CompatCodec&);
 
-  void normalDecode(const char* data, const int size, const int maxdata) throw(RuntimeException);
-  bool optimizedDecode(const char* data, const int size) throw(RuntimeException);
+  void normalDecode(const char* data, const int size, const int maxdata) noexcept(false);
+  bool optimizedDecode(const char* data, const int size) noexcept(false);
 };
 
 }