OSB_LIB::E164Map Class Reference

Collaboration diagram for OSB_LIB::E164Map:

Collaboration graph
[legend]
List of all members.

Detailed Description

Support efficient mapping E164 -> connection point.

Remarks:
Copy constructor, assignment and destructor by compiler.

Definition at line 111 of file e164map.h.

Public Member Functions

Private Types

Private Member Functions

Private Attributes

Friends

Classes


Member Typedef Documentation

typedef std::map<char, Leaf> OSB_LIB::E164Map::Leaves [private]

Map with follow-up digits.

Definition at line 183 of file e164map.h.

typedef std::map<NwAddress::Ton, Leaves> OSB_LIB::E164Map::Tons [private]

Map with Tons.

Definition at line 185 of file e164map.h.


Constructor & Destructor Documentation

OSB_LIB::E164Map::E164Map (  ) 

Default constructor.

The default constructor sets the flag `needBuild_' to true.


Member Function Documentation

void OSB_LIB::E164Map::add ( const E164 e164,
const ConnectionPt cp 
) [private]

Add an E.164 number.

void OSB_LIB::E164Map::build ( const TariffCatalogue tcat  ) 

Build the map.

The function loops over all E164 as contained in TariffCatalogue.e164s. Every E164 that has a connection point assigned and whose value is not empty is added to the internal structure.

Parameters:
tcat Reference to the tariff catalogue.
Exceptions:
OsbException 
  • Connection point assigned to an E164 can not be found in the tariff catalogue.

Id<ConnectionPt> OSB_LIB::E164Map::map2Cp ( NwAddress::Ton  ton,
const std::string &  e164,
const DateTime ts 
) const

Determine the connection point.

The function determines the most matching configured E164 number for which, at time `ts', a connection point is assigned:
Most matching means that, starting from left, the configured entry has the most number of equal digits with `e164'.

Example:
For the number `234567'

If configured and released at time `ts', the catchall entry (E164::catchall) will match any string (including an empty string).

Parameters:
ton Type of number.
e164 Normalized E164 phone number.
ts Date and time of the mapping.
Returns:
The id of the mapped connection point. It will not be set, if no match could be found.

void OSB_LIB::E164Map::print ( std::ostream &  os  )  const

Printing for testing purposes.


Friends And Related Function Documentation

friend struct Leaf [friend]

Definition at line 119 of file e164map.h.

friend class TariffCatalogue [friend]

Provide access to `needBuild_' for the tariff catalogue.

Whenever a configuration related to E164 changes, the tariff catalogue must be able to set the (re)build flag.

Definition at line 118 of file e164map.h.


Member Data Documentation

std::map<NwAddress::Ton, MappedCp> OSB_LIB::E164Map::catchalls_ [private]

Connection points assigned to the catch-all entries.

Definition at line 223 of file e164map.h.

bool OSB_LIB::E164Map::needBuild_ [private]

Flag if the map need to be build.

This flag is set to true in the default constructor and cleared on successful completion of build.

The tariff catalogue sets this flag whenever an E164 configuration changes. Before giving read-only access to the map, the tariff catalogue checks the flag and ev. rebuilds the map.

Definition at line 235 of file e164map.h.

Tons OSB_LIB::E164Map::tons_ [private]

Map with type of number.

Definition at line 221 of file e164map.h.


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