Remove warnings
[anna.git] / example / diameter / launcher / MyCommunicator.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 example_diameter_launcher_MyCommunicator_hpp
10 #define example_diameter_launcher_MyCommunicator_hpp
11
12 // Project
13 #include <anna/core/core.hpp>
14 #include <anna/comm/comm.hpp>
15 #include <anna/diameter/codec/Message.hpp>
16
17 // Process
18 #include <MyHandler.hpp>
19
20
21 class MyCommunicator : public anna::comm::Communicator {
22 public:
23   MyCommunicator(const anna::comm::Communicator::WorkMode::_v acceptMode = anna::comm::Communicator::WorkMode::Single) : anna::comm::Communicator(acceptMode),
24     a_contexts("Contexts")
25   {;}
26
27   void prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const throw();
28   void terminate() throw();
29
30 private:
31   using anna::comm::Communicator::eventBreakConnection;
32
33   anna::ThreadData <MyHandler> a_contexts;
34   void eventReceiveMessage(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException);
35   void eventBreakConnection(Server* server) throw();
36 };
37
38 #endif