ANNA Suite  2020b
Multipurpose development suite for Telco applications
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
anna::diameter::stack::Dictionary Class Reference

#include <Dictionary.hpp>

Classes

struct  lessAvp
 
struct  lessCommand
 

Public Types

typedef std::map< std::string, Formatformat_container
 
typedef format_container::const_iterator const_format_iterator
 
typedef std::map< S32, Vendorvendor_container
 
typedef vendor_container::const_iterator const_vendor_iterator
 
typedef std::map< AvpId, Avp, lessAvpavp_container
 
typedef avp_container::const_iterator const_avp_iterator
 
typedef std::map< CommandId, Command, lessCommandcommand_container
 
typedef command_container::const_iterator const_command_iterator
 

Public Member Functions

 Dictionary ()
 
 ~Dictionary ()
 
const std::string & getName () const
 
const FormatgetFormat (const std::string &formatName) const
 
const VendorgetVendor (S32 vendorId) const
 
const VendorgetVendor (const std::string &vendorName) const
 
const AvpgetAvp (const AvpId &avpId) const
 
const AvpgetAvp (const std::string &avpName) const
 
const CommandgetCommand (const CommandId &commandId) const
 
const CommandgetCommand (const std::string &commandName) const
 
void allowUpdates (bool allow=true)
 
void addFormat (const Format &, bool reserved=false) noexcept(false)
 
void addVendor (const Vendor &) noexcept(false)
 
void addAvp (const Avp &) noexcept(false)
 
void addCommand (const Command &) noexcept(false)
 
const_format_iterator format_begin () const
 
const_format_iterator format_end () const
 
int format_size () const
 
const_vendor_iterator vendor_begin () const
 
const_vendor_iterator vendor_end () const
 
int vendor_size () const
 
const_avp_iterator avp_begin () const
 
const_avp_iterator avp_end () const
 
int avp_size () const
 
const_command_iterator command_begin () const
 
const_command_iterator command_end () const
 
int command_size () const
 
std::string asString (void) const
 
anna::xml::NodeasXML (anna::xml::Node *parent) const
 
std::string asXMLString () const
 
virtual void load (const std::string &pathFile) noexcept(false)
 
void clear (void)
 

Protected Attributes

std::string a_name
 

Detailed Description

Dictionary information

Member Typedef Documentation

◆ avp_container

◆ command_container

◆ const_avp_iterator

typedef avp_container::const_iterator anna::diameter::stack::Dictionary::const_avp_iterator

◆ const_command_iterator

typedef command_container::const_iterator anna::diameter::stack::Dictionary::const_command_iterator

◆ const_format_iterator

typedef format_container::const_iterator anna::diameter::stack::Dictionary::const_format_iterator

◆ const_vendor_iterator

typedef vendor_container::const_iterator anna::diameter::stack::Dictionary::const_vendor_iterator

◆ format_container

◆ vendor_container

Constructor & Destructor Documentation

◆ Dictionary()

anna::diameter::stack::Dictionary::Dictionary ( )

◆ ~Dictionary()

anna::diameter::stack::Dictionary::~Dictionary ( )
inline
127 {};

Member Function Documentation

◆ addAvp()

void anna::diameter::stack::Dictionary::addAvp ( const Avp )
noexcept

◆ addCommand()

void anna::diameter::stack::Dictionary::addCommand ( const Command )
noexcept

◆ addFormat()

void anna::diameter::stack::Dictionary::addFormat ( const Format ,
bool  reserved = false 
)
noexcept

◆ addVendor()

void anna::diameter::stack::Dictionary::addVendor ( const Vendor )
noexcept

◆ allowUpdates()

void anna::diameter::stack::Dictionary::allowUpdates ( bool  allow = true)
inline
140 { a_allowUpdates = allow; }

◆ asString()

std::string anna::diameter::stack::Dictionary::asString ( void  ) const

Class string representation

Returns
String with class content

◆ asXML()

anna::xml::Node* anna::diameter::stack::Dictionary::asXML ( anna::xml::Node parent) const

Class XML representation.

Parameters
parentXML node over which we will put instance information.
Returns
XML documentcon with class content.

◆ asXMLString()

std::string anna::diameter::stack::Dictionary::asXMLString ( ) const

Class XML string representation

Returns
XML string representation with class content.

◆ avp_begin()

const_avp_iterator anna::diameter::stack::Dictionary::avp_begin ( ) const
inline
155 { return a_avps.begin(); }

◆ avp_end()

const_avp_iterator anna::diameter::stack::Dictionary::avp_end ( ) const
inline
156 { return a_avps.end(); }

◆ avp_size()

int anna::diameter::stack::Dictionary::avp_size ( ) const
inline
157 { return a_avps.size(); }

◆ clear()

void anna::diameter::stack::Dictionary::clear ( void  )
inline

Clears dictionary content

212 { initialize(); } // initialize and prepares the dictionary

◆ command_begin()

const_command_iterator anna::diameter::stack::Dictionary::command_begin ( ) const
inline
159 { return a_commands.begin(); }

◆ command_end()

const_command_iterator anna::diameter::stack::Dictionary::command_end ( ) const
inline
160 { return a_commands.end(); }

◆ command_size()

int anna::diameter::stack::Dictionary::command_size ( ) const
inline
161 { return a_commands.size(); }

◆ format_begin()

const_format_iterator anna::diameter::stack::Dictionary::format_begin ( ) const
inline
147 { return a_formats.begin(); }

◆ format_end()

const_format_iterator anna::diameter::stack::Dictionary::format_end ( ) const
inline
148 { return a_formats.end(); }

◆ format_size()

int anna::diameter::stack::Dictionary::format_size ( ) const
inline
149 { return a_formats.size(); }

◆ getAvp() [1/2]

const Avp* anna::diameter::stack::Dictionary::getAvp ( const AvpId avpId) const

◆ getAvp() [2/2]

const Avp* anna::diameter::stack::Dictionary::getAvp ( const std::string &  avpName) const

◆ getCommand() [1/2]

const Command* anna::diameter::stack::Dictionary::getCommand ( const CommandId commandId) const

◆ getCommand() [2/2]

const Command* anna::diameter::stack::Dictionary::getCommand ( const std::string &  commandName) const

◆ getFormat()

const Format* anna::diameter::stack::Dictionary::getFormat ( const std::string &  formatName) const

◆ getName()

const std::string& anna::diameter::stack::Dictionary::getName ( void  ) const
inline
130 { return a_name; }
std::string a_name
Definition: Dictionary.hpp:86

◆ getVendor() [1/2]

const Vendor* anna::diameter::stack::Dictionary::getVendor ( S32  vendorId) const

◆ getVendor() [2/2]

const Vendor* anna::diameter::stack::Dictionary::getVendor ( const std::string &  vendorName) const

◆ load()

virtual void anna::diameter::stack::Dictionary::load ( const std::string &  pathFile)
virtualnoexcept

Loads an XML dictionary document over the diameter dictionary.

Successive loadings will imply data accumulation, and the behaviour for redefinitions could be configured in two ways: allow updating for dictionary items, or launch exception when any collision is found. This could be set at allowUpdates, and default value deny such redefinitions. It could be interesting, in order to keep a more compact multi-stack configuration, allow updates sharing out the whole stack dictionaries as many parts as possible to get centralized definitions. I.e. common vendors and avps used at a unique xml file, and stack-specific commands in other set of xml files. Application only would have to load common part for all the created dictionaries with this method and specific one for each final dictionary:

Parameters
pathFilePath file to the xml document which represents the diameter dictionary.
Dictionary *nokiaStack = stackEngine.createDictionary("/var/tmp/vendors_and_avps.xml", NOKIA_STACK_ID);
Dictionary *huaweiStack = stackEngine.createDictionary("/var/tmp/vendors_and_avps.xml", HUAWEI_STACK_ID);
nokiaStack->load("/var/tmp/nokia_commands.xml");
huaweiStack->load("/var/tmp/huawei_commands.xml");

◆ vendor_begin()

const_vendor_iterator anna::diameter::stack::Dictionary::vendor_begin ( ) const
inline
151 { return a_vendors.begin(); }

◆ vendor_end()

const_vendor_iterator anna::diameter::stack::Dictionary::vendor_end ( ) const
inline
152 { return a_vendors.end(); }

◆ vendor_size()

int anna::diameter::stack::Dictionary::vendor_size ( ) const
inline
153 { return a_vendors.size(); }

Member Data Documentation

◆ a_name

std::string anna::diameter::stack::Dictionary::a_name
protected

The documentation for this class was generated from the following file: