X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2FProgrammedAnswers.hpp;h=00b9d4def601e1098a1e3a8bea38e96503a26e5f;hb=97a93101fb874a3237083d72c6d6f8c8df8dcfba;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=705d780f70b3596a222479ec7ad0dc3b3ab192cf;p=anna.git diff --git a/example/diameter/launcher/ProgrammedAnswers.hpp b/example/diameter/launcher/ProgrammedAnswers.hpp index e69de29..00b9d4d 100644 --- a/example/diameter/launcher/ProgrammedAnswers.hpp +++ b/example/diameter/launcher/ProgrammedAnswers.hpp @@ -0,0 +1,53 @@ +// ANNA - Anna is Not Nothingness Anymore // +// // +// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // +// // +// See project site at http://redmine.teslayout.com/projects/anna-suite // +// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // + + +#ifndef example_diameter_launcher_ProgrammedAnswers_hpp +#define example_diameter_launcher_ProgrammedAnswers_hpp + +// Standard +#include +#include +#include + +namespace anna { + namespace diameter { + namespace codec { + class Message; + } + } +} + + +class ProgrammedAnswers { + +typedef std::deque codec_messages_deque; +typedef std::deque::iterator codec_messages_deque_iterator; +typedef std::deque::const_iterator codec_messages_deque_const_iterator; +typedef std::map < int /* message code */, codec_messages_deque* > reacting_answers_container; +typedef std::map < int /* message code */, codec_messages_deque* >::iterator reacting_answers_iterator; +typedef std::map < int /* message code */, codec_messages_deque* >::const_iterator reacting_answers_const_iterator; + + reacting_answers_container a_deques; + bool a_rotate; + + public: + ProgrammedAnswers() { a_rotate = false; } + ~ProgrammedAnswers() { clear(); } + + bool rotate() const throw() { return a_rotate; } + void rotate(bool r) throw() { a_rotate = r; } + + void clear () throw(); + void dump () throw(); + void addMessage(int code, anna::diameter::codec::Message *message) throw(); + anna::diameter::codec::Message* getMessage(int code) const throw(); + void nextMessage(int code) throw(); + std::string asString(const char *queueName) const throw(); +}; + +#endif