1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
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 //
9 #ifndef example_diameter_launcher_ProgrammedAnswers_hpp
10 #define example_diameter_launcher_ProgrammedAnswers_hpp
27 class ProgrammedAnswers {
29 typedef std::deque<anna::diameter::codec::Message*> codec_messages_deque;
30 typedef std::deque<anna::diameter::codec::Message*>::iterator codec_messages_deque_iterator;
31 typedef std::deque<anna::diameter::codec::Message*>::const_iterator codec_messages_deque_const_iterator;
32 typedef std::map < int /* message code */, codec_messages_deque* > reacting_answers_container;
33 typedef std::map < int /* message code */, codec_messages_deque* >::iterator reacting_answers_iterator;
34 typedef std::map < int /* message code */, codec_messages_deque* >::const_iterator reacting_answers_const_iterator;
36 reacting_answers_container a_deques;
38 anna::diameter::codec::Engine *a_codecEngine;
41 ProgrammedAnswers() { a_rotate = false; }
42 ~ProgrammedAnswers() { clear(); }
44 void setCodecEngine(anna::diameter::codec::Engine *codecEngine) throw() { a_codecEngine = codecEngine; }
45 bool rotate() const throw() { return a_rotate; }
46 void rotate(bool r) throw() { a_rotate = r; }
48 void clear () throw();
50 void addMessage(int code, anna::diameter::codec::Message *message) throw();
51 anna::diameter::codec::Message* getMessage(int code) const throw();
52 void nextMessage(int code) throw();
53 std::string asString(const char *queueName) const throw();