Remove dynamic exceptions
[anna.git] / include / anna / comm / ClientSocket.hpp
index 2b661f8..a7850f7 100644 (file)
@@ -126,32 +126,32 @@ public:
      Devuelve la direccion remota del socket.
      \return La direccion remota del socket.
   */
-  const AccessPoint& getRemoteAccessPoint() const throw() { return a_remoteAccessPoint; }
+  const AccessPoint& getRemoteAccessPoint() const { return a_remoteAccessPoint; }
 
   /**
      Devuelve el estado de conexion de este socket.
      \return \em true si el socket mantiene la conexion realizada mediante el metodo #connect o
      \em false en otro caso.
   */
-  bool isConnected() const throw() { return (a_status & Status::Connected) != 0; }
+  bool isConnected() const { return (a_status & Status::Connected) != 0; }
 
   /**
      Devuelve el estado del contenido del socket.
      \return \em true si el socket mantiene el sincronismo o \em false en otro caso.
   */
-  bool isSynchronized() const throw() { return (a_status & Status::Corrupt) == 0; }
+  bool isSynchronized() const { return (a_status & Status::Corrupt) == 0; }
 
   /**
      Devuelve el estado del contenido del socket.
      \return \em true si el socket NO mantiene el sincronismo o \em false en otro caso.
   */
-  bool isCorrupt() const throw() { return (a_status & Status::Corrupt); }
+  bool isCorrupt() const { return (a_status & Status::Corrupt); }
 
   /**
    * Devuelve el estado de cierre del socket.
    * \return \em true si el socket está a la espera de ser cerrado o \em false en otro caso.
    */
-  bool isClosedPending() const throw() { return (a_status & Status::ClosePending) != 0; }
+  bool isClosedPending() const { return (a_status & Status::ClosePending) != 0; }
 
   /**
      Devuelve la instancia de anna::comm::Server asociado a una conexion remota iniciada por
@@ -161,7 +161,7 @@ public:
      \warning Puede ser NULL en caso de que este ClientSocket corresponda a una conexion local
      establecida por un proceso remoto contra un ServerSocket de nuestra aplicacion.
   */
-  Server* getServer() throw(RuntimeException);
+  Server* getServer() noexcept(false);
 
   /**
      Devuelve el numero maximo de milisegundos esperados para obtener conexion al invocar
@@ -169,7 +169,7 @@ public:
      \return el numero maximo de milisegundos esperados para obtener conexion al invocar
      al metodo #connect.
   */
-  const Millisecond &getMaxConnectionDelay() const throw() { return a_msMaxConnectionDelay; }
+  const Millisecond &getMaxConnectionDelay() const { return a_msMaxConnectionDelay; }
 
   /**
      Devuelve el numero maximo de milisegundos que queda bloqueado el proceso/thread a la espera
@@ -177,7 +177,7 @@ public:
      \return Devuelve el numero maximo de milisegundos que queda bloqueado el proceso/thread a la espera
      de escribir en un socket cuyo buffer de salida esta lleno.
   */
-  const Millisecond &getMaxWriteDelay() const throw() { return a_msMaxWriteDelay; }
+  const Millisecond &getMaxWriteDelay() const { return a_msMaxWriteDelay; }
 
   /**
      Obtiene toda la informacion referente a este socket a partir de la conexion realizada atraves del \em fd
@@ -185,7 +185,7 @@ public:
      \param fd File descriptor correspondiente a una conexion local.
      \warning Exclusivamente uso interno.
   */
-  virtual void setfd(const int fd) throw(RuntimeException);
+  virtual void setfd(const int fd) noexcept(false);
 
   /**
      Establece el numero maximo de milisegundos esperados para obtener la conexion al
@@ -195,7 +195,7 @@ public:
      \see anna::comm::Server::setMaxConnectionDelay.
   */
   void setMaxConnectionDelay(const Millisecond &msMaxConnectionDelay)
-  throw() {
+  {
     a_msMaxConnectionDelay = msMaxConnectionDelay;
   }
 
@@ -205,24 +205,24 @@ public:
 
      \param msMaxWriteDelay Numero de milisegundos esperados en caso de que el buffer del socket se llene.
   */
-  void setMaxWriteDelay(const Millisecond &msMaxWriteDelay) throw() { a_msMaxWriteDelay = msMaxWriteDelay; }
+  void setMaxWriteDelay(const Millisecond &msMaxWriteDelay) { a_msMaxWriteDelay = msMaxWriteDelay; }
 
   /**
    * Devuelve \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso.
    * \return \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso.
    */
-  bool getIgnoreIncomingMessages() const throw() { return a_ignoreIncomingMessages; }
+  bool getIgnoreIncomingMessages() const { return a_ignoreIncomingMessages; }
 
   /**
    * Establece el indicador que provoca ignorar los mensajes entrantes.
    * \param ignoreIncomingMessages \em true si el indicador que ignora los mensajes entrantes está activo, o \em false en otro caso.
    */
-  void setIgnoreIncomingMessages(const bool ignoreIncomingMessages) throw() { a_ignoreIncomingMessages = ignoreIncomingMessages; }
+  void setIgnoreIncomingMessages(const bool ignoreIncomingMessages) { a_ignoreIncomingMessages = ignoreIncomingMessages; }
 
   /**
      Intenta la conexion remota con la direccion indicada en el constructor.
   */
-  virtual void connect() throw(RuntimeException);
+  virtual void connect() noexcept(false);
 
   /**
      Envia el mensaje recibido como parametro. Al bloque de datos correspondiente a la
@@ -231,7 +231,7 @@ public:
 
      \param message Mensaje que vamos codificar para enviar a la capa de transporte.
   */
-  void send(Message& message) throw(RuntimeException);
+  void send(Message& message) noexcept(false);
 
   /**
      Envia el mensaje recibido como parametro. Al bloque de datos correspondiente a la
@@ -240,7 +240,7 @@ public:
 
      \param message Mensaje que vamos codificar para enviar a la capa de transporte.
   */
-  void send(Message* message) throw(RuntimeException);
+  void send(Message* message) noexcept(false);
 
   /**
      Espera la llegada de mensajes por este ClientSocket durante un numero de milisegundos
@@ -250,7 +250,7 @@ public:
      \code
 
      void f (anna::ClientSocket* clientSocket)
-        throw (anna::RuntimeException)
+        noexcept(false)
      {
         anna::Guard (clientSocket);
 
@@ -281,18 +281,18 @@ public:
      \li La invocacion al metodo #receive y al #fetch deben estar protegidas por la misma
      seccion critica.
   */
-  Notify::_v wait(const Millisecond &timeout, const bool receive = true) throw(RuntimeException);
+  Notify::_v wait(const Millisecond &timeout, const bool receive = true) noexcept(false);
 
   /**
      Elimina el contenido del buffer de recepcion.
   */
-  void forgot() throw();
+  void forgot() ;
 
   /**
      Obtiene la capa de transporte asociada a este ClientSocket.
      \return la capa de transporte asociada a este ClientSocket.
   */
-  Transport* getTransport() throw(RuntimeException) {
+  Transport* getTransport() noexcept(false) {
     return (a_transport != NULL) ? a_transport : reserveTransport();
   }
 
@@ -301,7 +301,7 @@ public:
      \return el receptor asociado a este ClientSocket.Puede ser NULL
      \warning Exclusivamente uso interno.
   */
-  Receiver* getReceiver() throw(RuntimeException) {
+  Receiver* getReceiver() noexcept(false) {
     return (a_receiver != NULL) ? a_receiver : ((a_receiverFactory == NULL) ? NULL : reserveReceiver());
   }
 
@@ -311,45 +311,45 @@ public:
    * intermedia, invoca directamente al metodo anna::comm::Receiver::initialize.
    * \param receive La instancia del receptor externo que tratar los mensajes de este socket.
    */
-  void setReceiver(Receiver* receive) throw(RuntimeException);
+  void setReceiver(Receiver* receive) noexcept(false);
 
   /**
      Activa la solicitud de cierre del socket, que se llevara a cabo cuando el nucleo considere
      que se puede realizar de forma segura, desde el punto de vista de la informacion bloqueada
      por secciones criticas en los distintos componentes, que hacen uso del socket.
   */
-  void requestClose() throw();
+  void requestClose() ;
 
   /**
      Devuelve el estado de la solicitud de cierre del socket.
      \return el estado de la solicitud de cierre del socket.
   */
-  bool hasRequestedClose() const throw() { return (a_status & Status::ClosePending) != 0; }
+  bool hasRequestedClose() const { return (a_status & Status::ClosePending) != 0; }
 
   /**
      Devuelve una cadena con la informacin referente a este socket.
      \return Una cadena con la informacin referente a este socket.
   */
-  virtual std::string asString() const throw();
+  virtual std::string asString() const ;
 
   /**
      Devuelve un nodo XML con la informacin referente a este objeto.
      \param parent Nodo XML a partir del cual introducir la informacin.
      \return Un nodo XML con la informacin referente a este objeto.
   */
-  virtual xml::Node* asXML(xml::Node* parent) const throw(RuntimeException);
+  virtual xml::Node* asXML(xml::Node* parent) const noexcept(false);
 
   /**
      Devuelve el nombre logico de esta clase.
      \return el nombre logico de esta clase.
   */
-  static const char* className() throw() { return "anna::comm::ClientSocket"; }
+  static const char* className() { return "anna::comm::ClientSocket"; }
 
 protected:
   struct Status {
     enum _v { None = 0, Connected = 1, Corrupt = 2, ClosePending = 4, Working = 8 };
 
-    static std::string asString(const int status) throw();
+    static std::string asString(const int status) ;
   };
 
   Transport* a_transport;
@@ -359,19 +359,19 @@ protected:
      Devuelve el numero de bytes contenido en el buffer intermedio de recepcion.
      \return El numero de bytes contenido en el buffer intermedio de recepcion.
   */
-  int getBufferSize() const throw() { return a_data.getSize() - a_offset; }
+  int getBufferSize() const { return a_data.getSize() - a_offset; }
 
   /**
      Devuelve el numero maximo de bytes que puede tener en el buffer intermedio de recepcion.
      \return el numero maximo de bytes que puede tener en el buffer intermedio de recepcion.
   */
-  int getReceiveBufferSize() const throw() { return a_rcvBufferSize; }
+  int getReceiveBufferSize() const { return a_rcvBufferSize; }
 
   /**
      Obtiene los parametros de funcionamiento del Socket.
      \warning Exclusivamente uso interno.
   */
-  void getSocketOptions() throw(RuntimeException);
+  void getSocketOptions() noexcept(false);
 
   /**
      Recupera el ultimo mensaje recibido.
@@ -385,7 +385,7 @@ protected:
      \code
 
      void f (anna::ClientSocket* clientSocket)
-        throw (anna::RuntimeException)
+        noexcept(false)
      {
         anna::Guard (clientSocket);
 
@@ -402,7 +402,7 @@ protected:
 
      \endcode
   */
-  Notify::_v receive() throw(RuntimeException);
+  Notify::_v receive() noexcept(false);
 
   /**
      Recupera el ultimo bloque de datos recuperado mediante el metodo #receive o #wait.
@@ -415,16 +415,16 @@ protected:
      \warning Exclusivamente uso interno. Debe invocarse con una seccion
      critica activa sobre el ClientSocket.
   */
-  const DataBlock* fetch() throw(RuntimeException);
+  const DataBlock* fetch() noexcept(false);
 
-  void activate(const Status::_v v) throw() { a_status |= v; }
-  void deactivate(const Status::_v v) throw() { a_status &= ~v; }
-  void deactivate(const int v) throw() { a_status &= ~v; }
+  void activate(const Status::_v v) { a_status |= v; }
+  void deactivate(const Status::_v v) { a_status &= ~v; }
+  void deactivate(const int v) { a_status &= ~v; }
 
-  virtual int do_connect(const sockaddr*, const int len) throw(RuntimeException);
-  virtual void do_write(const DataBlock&) throw(RuntimeException);
-  virtual int do_read(const char* data, const int size) throw(RuntimeException);
-  virtual void do_close() throw();
+  virtual int do_connect(const sockaddr*, const int len) noexcept(false);
+  virtual void do_write(const DataBlock&) noexcept(false);
+  virtual int do_read(const char* data, const int size) noexcept(false);
+  virtual void do_close() ;
 
 private:
   struct PendingBytes {
@@ -459,12 +459,12 @@ private:
   mutable PendingBytes a_pendingBytes;
   bool a_ignoreIncomingMessages;
 
-  void initialize() throw();
-  void calculeExpectedSize(const DataBlock&) throw();
-  Transport* reserveTransport() throw(RuntimeException);
-  Transport* unsafe_reserveTransport() throw(RuntimeException);
-  Receiver* reserveReceiver() throw(RuntimeException);
-  int getTotalPendingBytes() const throw();
+  void initialize() ;
+  void calculeExpectedSize(const DataBlock&) ;
+  Transport* reserveTransport() noexcept(false);
+  Transport* unsafe_reserveTransport() noexcept(false);
+  Receiver* reserveReceiver() noexcept(false);
+  int getTotalPendingBytes() const ;
 
   friend class Communicator;
   // unsafe_reserveTransport