Revert "Remove mysql and oracle resources for anna-ericsson project"
[anna.git] / example / diameter / rxSimpleTest / 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
18 class MyCommunicator : public anna::comm::Communicator {
19 public:
20   MyCommunicator(const anna::comm::Communicator::WorkMode::_v acceptMode = anna::comm::Communicator::WorkMode::Single) : anna::comm::Communicator(acceptMode)
21   {;}
22
23   void prepareAnswer(anna::diameter::codec::Message *answer, const anna::DataBlock &request) const throw();
24   void terminate() throw();
25
26 private:
27   using anna::comm::Communicator::eventBreakConnection;
28
29   void eventReceiveMessage(anna::comm::ClientSocket&, const anna::comm::Message&) throw(anna::RuntimeException);
30   void eventBreakConnection(Server* server) throw();
31 };
32
33 #endif