#include <anna/diameter/defines.hpp>
#include <anna/diameter/codec/basetypes/basetypes.hpp>
#include <anna/diameter/stack/Avp.hpp>
-#include <anna/diameter/helpers/tme/codectypes/codectypes.hpp>
#include <anna/core/RuntimeException.hpp>
namespace diameter {
-namespace helpers {
-namespace tme {
-namespace codectypes {
-class Unsigned16;
-class ISDNNumber;
-class ISDNAddress;
-}
-}
-}
-
-
namespace stack {
class Dictionary;
class Format;
using namespace basetypes;
-using namespace helpers::tme::codectypes;
/**
* Diameter avp generic container
QoSFilterRule *a_QoSFilterRule;
Unknown *a_Unknown;
- // Derived formats ////////////////////////////////////////////
- /* TME */
- ISDNNumber *a_ISDNNumber;
- ISDNAddress *a_ISDNAddress;
- Unsigned16 *a_Unsigned16;
-
-
-
// Grouped helpers
find_container a_finds; // fast access for grouped and message first-level avps
static const Avp* avp(const_avp_iterator ii) throw() { return ii->second; }
// Internal
- void assertFormat(const std::string &name) const throw(anna::RuntimeException);
bool flagsOK() const throw(); // flags coherence regarding dictionary. Only must be called when AVP is identified at the dictionary.
int addChild(Avp *avp) throw(anna::RuntimeException) { assertFormat("Grouped"); return addChild(a_avps, a_insertionPositionForChilds, avp); }
bool hasChildren() throw() { return a_avps.size() != 0; }
/**
* Initializes Avp class information.
- * Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+ * Default implementation supports all anna::diameter formats (including derived ones).
* Diameter basic formats are managed at #initialize, which will invoke this method at the end.
*/
- virtual void initializeByFormat() throw();
+ virtual void initializeByFormat() throw() {};
/**
* Gets avp data-part length.
- * Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+ * Default implementation supports all anna::diameter formats (including derived ones).
* Diameter basic formats are managed at #initialize, which will invoke this method at the end.
*
* @param stackFormat Stack avp format in which data extraction is based.
*
* @return Avp data-part size.
*/
- virtual U24 getLengthByFormat(const anna::diameter::stack::Format *stackFormat) const throw();
+ virtual U24 getLengthByFormat(const anna::diameter::stack::Format *stackFormat) const throw() { return 0; };
/**
Gets data or hexadecimal data depending on avp format, for xml creating
- Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+ Default implementation supports all anna::diameter formats (including derived ones).
Diameter basic formats are managed at #initialize, which will invoke this method at the end.
\param isHex Hexadecimal/Natural data when apply.
\param stackFormat Stack avp format in which data extraction is based.
\return xml data representation
*/
- virtual std::string getXMLdataByFormat(bool & isHex, const anna::diameter::stack::Format *stackFormat) const throw();
+ virtual std::string getXMLdataByFormat(bool & isHex, const anna::diameter::stack::Format *stackFormat) const throw() { return ""; };
/**
Interpret xml data in order to dump over the class content.
- Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+ Default implementation supports all anna::diameter formats (including derived ones).
Diameter basic formats are managed at #initialize, which will invoke this method at the end.
\param data Avp data attribute
\param hexData Avp hex-data attribute
\param stackFormat Stack avp format in which data extraction is based.
*/
- virtual void fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException);
+ virtual void fromXMLByFormat(const anna::xml::Attribute* data, const anna::xml::Attribute* hexData, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException) {};
/**
Encodes buffer with the class content.
- Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+ Default implementation supports all anna::diameter formats (including derived ones).
Diameter basic formats are managed at #initialize, which will invoke this method at the end.
@param dataPart Data-part begin pointer
@param stackFormat Stack avp format in which data extraction is based.
*/
- virtual void codeByFormat(char* dataPart, const anna::diameter::stack::Format *stackFormat) const throw(anna::RuntimeException);
+ virtual void codeByFormat(char* dataPart, const anna::diameter::stack::Format *stackFormat) const throw(anna::RuntimeException) {};
/**
Decodes Avp data part.
- Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+ Default implementation supports all anna::diameter formats (including derived ones).
Diameter basic formats are managed at #initialize, which will invoke this method at the end.
@param buffer Avp data part start pointer
@param size Avp data part size
@param stackFormat Stack avp format in which data extraction is based.
*/
- virtual void decodeDataPartByFormat(const char * buffer, int size, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException);
+ virtual void decodeDataPartByFormat(const char * buffer, int size, const anna::diameter::stack::Format *stackFormat) throw(anna::RuntimeException) {};
/**
Reserves memory for data part depending on avp format for the identifier provided.
- Default implementation supports all anna::diameter formats (including i.e. tme.db ones).
+ Default implementation supports all anna::diameter formats (including derived ones).
Diameter basic formats are managed at #initialize, which will invoke this method at the end.
@param stackFormat Stack avp format in which data extraction is based.
*/
- virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) throw();
+ virtual void allocationByFormat(const anna::diameter::stack::Format *stackFormat) throw() {};
/**
* Clears Avp data-part format containers.
*/
- virtual void clearByFormat() throw();
+ virtual void clearByFormat() throw() {};
*/
void initialize() throw();
+ /**
+ * Assert format regarding dictionary
+ */
+ void assertFormat(const std::string &name) const throw(anna::RuntimeException);
/**
* Gets avp total length based on internal data part and header configuration.
/** Access content for Unknown Avp in order to set data part */
Unknown * getUnknown() throw(anna::RuntimeException) { assertFormat("Unknown"); return a_Unknown; }
- // Derived formats ////////////////////////////////////////////
- /* TME */
- /** Access content for ISDNNumber Avp in order to set data part */
- ISDNNumber * getISDNNumber() throw(anna::RuntimeException) { assertFormat("ISDNNumber"); return a_ISDNNumber; }
- /** Access content for ISDNAddress Avp in order to set data part */
- ISDNAddress * getISDNAddress() throw(anna::RuntimeException) { assertFormat("ISDNAddress"); return a_ISDNAddress; }
- /** Access content for Unsigned16 Avp in order to set data part */
- Unsigned16 * getUnsigned16() throw(anna::RuntimeException) { assertFormat("Unsigned16"); return a_Unsigned16; }
-
/**
Removes an Avp within grouped type (first level) and free resources.
const Unknown * getUnknown() const throw(anna::RuntimeException) { assertFormat("Unknown"); return a_Unknown; }
- // Derived formats ////////////////////////////////////////////
- /* TME */
- /** Access content for ISDNNumber Avp */
- const ISDNNumber * getISDNNumber() const throw(anna::RuntimeException) { assertFormat("ISDNNumber"); return a_ISDNNumber; }
- /** Access content for ISDNAddress Avp */
- const ISDNAddress * getISDNAddress() const throw(anna::RuntimeException) { assertFormat("ISDNAddress"); return a_ISDNAddress; }
- /** Access content for Unsigned16 Avp */
- const Unsigned16 * getUnsigned16() const throw(anna::RuntimeException) { assertFormat("Unsigned16"); return a_Unsigned16; }
-
-
// Helpers
/**