Remove dynamic exceptions
[anna.git] / include / anna / comm / handler / DatagramSocket.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_handler_DatagramSocket_hpp
10 #define anna_comm_handler_DatagramSocket_hpp
11
12 #include <anna/comm/handler/MetaClientSocket.hpp>
13
14 #include <anna/comm/handler/Allocator.hpp>
15
16 namespace anna {
17
18 namespace comm {
19
20 class DatagramSocket;
21
22 namespace handler {
23
24 class DatagramSocket : public MetaClientSocket {
25 public:
26   DatagramSocket(Communicator* communicator) :
27     MetaClientSocket(communicator, Handler::Type::DatagramSocket),
28     a_datagramSocket(NULL)
29   {;}
30
31   void setup(comm::DatagramSocket* datagramSocket) { a_datagramSocket = datagramSocket; }
32
33   comm::ClientSocket* getClientSocket() ;
34
35 private:
36   comm::DatagramSocket* a_datagramSocket;
37
38   void initialize() noexcept(false);
39   void apply() noexcept(false);
40   void finalize() ;
41
42   std::string asString() const ;
43   xml::Node* asXML(xml::Node*) const ;
44 };
45
46 }
47 }
48 }
49
50 #endif
51