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_TestCondition_hpp
10 #define example_diameter_launcher_TestCondition_hpp
16 #include <anna/core/DataBlock.hpp>
30 struct Type { enum _v { Generic, Basic }; };
31 static const char* asText(const Type::_v type) throw();
33 TestCondition() : a_rcvFromEntity(true),
35 a_code(""), a_bitR(""), a_resultCode(""), a_sessionId(""),
36 a_hopByHop(""), a_msisdn(""), a_imsi(""), a_serviceContextId("") { a_type = Type::Basic; }
39 // Source of the received message
40 void setReceivedFromEntity(bool rfe) throw() { a_rcvFromEntity = rfe; }
41 bool receivedFromEntity() const throw() { return a_rcvFromEntity; }
44 void setRegexp(const std::string ®exp) throw() { a_regexp = regexp; }
46 void setCode(const std::string &value) throw() { a_code = value; }
47 void setBitR(const std::string &value) throw() { a_bitR = value; }
48 void setResultCode(const std::string &value) throw() { a_resultCode = value; }
49 void setSessionId(const std::string &value) throw() { a_sessionId = value; }
50 void setHopByHop(const std::string &value) throw() { a_hopByHop = value; }
51 void setMsisdn(const std::string &value) throw() { a_msisdn = value; }
52 void setImsi(const std::string &value) throw() { a_imsi = value; }
53 void setServiceContextId(const std::string &value) throw() { a_serviceContextId = value; }
55 bool exists() const throw();
56 friend bool operator==(const TestCondition &c1, const TestCondition &c2) throw();
59 const std::string & getRegexp() const throw() { return a_regexp; }
61 const std::string & getCode() const throw() { return a_code; }
62 const std::string & getBitR() const throw() { return a_bitR; }
63 const std::string & getResultCode() const throw() { return a_resultCode; }
64 const std::string & getSessionId() const throw() { return a_sessionId; }
65 const std::string & getHopByHop() const throw() { return a_hopByHop; }
66 const std::string & getMsisdn() const throw() { return a_msisdn; }
67 const std::string & getImsi() const throw() { return a_imsi; }
68 const std::string & getServiceContextId() const throw() { return a_serviceContextId; }
71 bool comply (const anna::DataBlock &message/*, bool matchSessionId*/) const throw();
74 anna::xml::Node* asXML(anna::xml::Node* parent) const throw();
79 // Source of the received message
91 std::string a_resultCode;
92 std::string a_sessionId;
93 std::string a_hopByHop;
96 std::string a_serviceContextId;