Dynamic lib selection and deployment
[anna.git] / example / diameter / launcher / ProgrammedAnswers.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_ProgrammedAnswers_hpp
10 #define example_diameter_launcher_ProgrammedAnswers_hpp
11
12 // Standard
13 #include <deque>
14 #include <map>
15 #include <string>
16
17 namespace anna {
18   namespace diameter {
19     namespace codec {
20       class Message;
21     }
22   }
23 }
24
25
26 class ProgrammedAnswers {
27
28 typedef std::deque<anna::diameter::codec::Message*> codec_messages_deque;
29 typedef std::deque<anna::diameter::codec::Message*>::iterator codec_messages_deque_iterator;
30 typedef std::deque<anna::diameter::codec::Message*>::const_iterator codec_messages_deque_const_iterator;
31 typedef std::map < int /* message code */, codec_messages_deque* > reacting_answers_container;
32 typedef std::map < int /* message code */, codec_messages_deque* >::iterator  reacting_answers_iterator;
33 typedef std::map < int /* message code */, codec_messages_deque* >::const_iterator  reacting_answers_const_iterator;
34
35   reacting_answers_container a_deques;
36   bool a_rotate;
37
38   public:
39     ProgrammedAnswers() { a_rotate = false; }
40     ~ProgrammedAnswers() { clear(); }
41
42     bool rotate() const throw() { return a_rotate; }
43     void rotate(bool r) throw() { a_rotate = r; }
44
45     void clear () throw();
46     void dump () throw();
47     void addMessage(int code, anna::diameter::codec::Message *message) throw();
48     anna::diameter::codec::Message* getMessage(int code) const throw();
49     void nextMessage(int code) throw();
50     std::string asString(const char *queueName) const throw();
51 };
52
53 #endif