00001 /* ${copyright}$ */ 00002 /* $Id: AsnCheckRsp.H 1040 2009-10-01 17:49:12Z fneves $ */ 00007 #ifndef __ASNCHECKRSP_H__ 00008 #define __ASNCHECKRSP_H__ 00009 00010 #include <vector> 00011 00012 #include "libepp_nicbr.H" 00013 00014 #include "Response.H" 00015 00016 using std::vector; 00017 00018 LIBEPP_NICBR_NS_BEGIN 00019 00021 class AsnCheckRsp : public Response 00022 { 00023 public: 00024 struct CheckData { 00025 int asn; 00026 bool available; 00027 string reason; 00028 string reason_lang; 00029 }; 00030 00032 AsnCheckRsp(bool reset = true) : Response(false) 00033 { 00034 if (reset) { 00035 this->reset(); 00036 } 00037 } 00038 00040 00046 void insert_availability(const int asn, const bool available, 00047 const string &reason, 00048 const string &reason_lang = "") 00049 { 00050 CheckData cd; 00051 cd.asn = asn; 00052 cd.available = available; 00053 cd.reason = reason; 00054 cd.reason_lang = reason_lang; 00055 _availability_list.push_back(cd); 00056 } 00057 00059 00062 vector<CheckData> get_availability_list() const 00063 { 00064 return _availability_list; 00065 } 00066 00067 void reset() 00068 { 00069 Response::reset(); 00070 _availability_list.clear(); 00071 } 00072 00073 protected: 00075 vector<CheckData> _availability_list; 00076 }; 00077 00078 LIBEPP_NICBR_NS_END 00079 #endif // __ASNCHECKRSP_H__