OSB_LIB::CountryInfoList Class Reference

Collaboration diagram for OSB_LIB::CountryInfoList:

Collaboration graph
[legend]
List of all members.

Detailed Description

It reads all the country info from the database and map to the E.164 number and to the object identifier. It returns the country info for the given object id or E.164 number.

Definition at line 129 of file countryinfo.h.

Public Types

Public Member Functions

Static Public Member Functions

Private Member Functions

Private Attributes

Static Private Attributes


Member Typedef Documentation

typedef std::map<std::string, CountryInfo*> OSB_LIB::CountryInfoList::E164CountryInfoMap

Map between the E.164 number and the country info.

Definition at line 133 of file countryinfo.h.

typedef std::map<CountryInfo::Oid, CountryInfo*> OSB_LIB::CountryInfoList::OidCountryInfoMap

Map between the object identifier and the country info.

Definition at line 136 of file countryinfo.h.


Constructor & Destructor Documentation

OSB_LIB::CountryInfoList::~CountryInfoList (  ) 

Destructor to destruct the singleton object.

OSB_LIB::CountryInfoList::CountryInfoList (  )  [inline, private]

Default constructor.

Definition at line 224 of file countryinfo.h.


Member Function Documentation

std::string OSB_LIB::CountryInfoList::countryCode ( const NwAddress nwAddress  ) 

Get the ISO 3166 3-letter country code for a network address.

Parameters:
nwAddress Network address for which the determine the country code.
Returns:
The IS0 3166 3-letter country code, empty if it can not be determined.
Remarks:
This function currently only supports the E.164 numbering plan and the number must start with the country code.
The returned valued is always empty if the NP is not NwAddress::npTelephony or TON is not NwAddress::tonInternational.

bool OSB_LIB::CountryInfoList::getCountryInfo ( const std::string &  dialledNum,
CountryInfo countryInfo 
) const

Get the country info object from the given string.

Only the first 5 characters of the passed in `e164cc' will be used to match the entries configured.

Parameters:
dialledNum The number dialled.
countryInfo The country info object as an output argument to get the country info for the given numeric code.
Returns:
True if the country info is identified for the given numeric code else false.

const CountryInfo& OSB_LIB::CountryInfoList::getCountryInfo ( const CountryInfo::Oid oid  ) 

Get the country info object for the given object identifier.

It gets the country info from the map by providing the object identifier. If there is no object for the given object id it will throw an osb exception.

Parameters:
oid Unique object identifier of the country info.
Exceptions:
Exception for the following.
  • No object for the given object id.
  • General database error.
Returns:
Reference to the country info object.

const CountryInfos& OSB_LIB::CountryInfoList::getCountryInfos (  )  const

Returns the country info list.

Returns:
List of all country info.

static CountryInfoList& OSB_LIB::CountryInfoList::instance (  )  [static]

This will return the same instance of CountryInfoList to everyone.

Returns:
Reference to the country info list object.

long OSB_LIB::CountryInfoList::read ( const OSB_DB::Session session  ) 

Read all the country info and map it to the corresponding number code and oid.

It reads all the country info from the database and map the country info with the E.164 number and map the same country info with the country info object id.

Parameters:
session Database session to use.
Exceptions:
Exception on general database error.
Returns:
Number of country info read from the database.


Member Data Documentation

CountryInfoList* OSB_LIB::CountryInfoList::ciList_ [static, private]

Pointer to the country info singleton object.

Definition at line 227 of file countryinfo.h.

CountryInfos OSB_LIB::CountryInfoList::countryInfos_ [private]

Container for the country info.

Definition at line 230 of file countryinfo.h.

E164CountryInfoMap OSB_LIB::CountryInfoList::e164CntryInfo_ [private]

Map between the numeric code and the country info reference. This is to identify the country info for the given E.164 number.

Definition at line 237 of file countryinfo.h.

OidCountryInfoMap OSB_LIB::CountryInfoList::oidCntryInfo_ [private]

Map between the object identifier and the country info reference. This is to identify the country info for the given object identifier.

Definition at line 244 of file countryinfo.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:15:25 2006 for OSB Library by  doxygen 1.4.7