Remove dynamic exceptions
[anna.git] / include / anna / comm / internal / RemoteConnection.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef anna_comm_internal_RemoteConnection_hpp
10 #define anna_comm_internal_RemoteConnection_hpp
11
12 namespace anna {
13
14 namespace xml {
15 class Node;
16 }
17
18 namespace comm {
19
20 class Server;
21 class ClientSocket;
22
23 class RemoteConnection  {
24 public:
25   Server* getServer() { return a_server; }
26
27   /**
28      Conversor de invocacion.
29      \return La instancia del socket asociado a esta instancia. Si no hay socket asociado lanzara una excepcion.
30   */
31   ClientSocket* getClientSocket() { return a_clientSocket; }
32
33   std::string asString() const ;
34   xml::Node* asXML(xml::Node* parent) const noexcept(false);
35   static const char* className() { return "anna::comm::RemoteConnection"; }
36
37 private:
38   Server* a_server;
39   ClientSocket* a_clientSocket;
40
41   RemoteConnection(Server* server, ClientSocket* clientSocket) :
42     a_server(server),
43     a_clientSocket(clientSocket)
44   {;}
45
46   friend class Server;
47 };
48
49 }
50 }
51
52 #endif
53