OSB_LIB::NumberAnalyzer Class Reference

Inheritance diagram for OSB_LIB::NumberAnalyzer:

Inheritance graph
[legend]
Collaboration diagram for OSB_LIB::NumberAnalyzer:

Collaboration graph
[legend]
List of all members.

Detailed Description

NumberAnalyzer is an abstract base class that defines the functionalities that can be applied to analyze and modify the phone numbers in Cdr (called and calling numbers).

Definition at line 73 of file numberanalyzer.h.

Database operations:

Public Types

Public Member Functions

Member functions to analyze a number:
Read access to data members:

Static Public Member Functions

Protected Member Functions

Private Member Functions

Derieved class database operations:

Private Attributes

Friends


Member Typedef Documentation

typedef std::auto_ptr<NumberAnalyzer> OSB_LIB::NumberAnalyzer::AutoPtr

Short-cut for an auto pointer.

For details see quality manual, implementation patterns: Virtual copy construction.

Definition at line 90 of file numberanalyzer.h.

typedef Id<NumberAnalyzer> OSB_LIB::NumberAnalyzer::Oid

Type-safe, unique id of a number analyzer.

Definition at line 82 of file numberanalyzer.h.


Member Enumeration Documentation

enum OSB_LIB::NumberAnalyzer::NumberAnalyzerType

Available number analyzer type.

Enumerator:
naTypeUnknown  Unknown type.
naType01  Type 01 of the number analysis object.

Type 01 can perform adding, removing, both adding and removing prefixes.

Definition at line 93 of file numberanalyzer.h.


Constructor & Destructor Documentation

OSB_LIB::NumberAnalyzer::NumberAnalyzer ( const Oid oid = Oid(),
const NumberAnalyzerType type = naTypeUnknown 
)

Constructor for creating either new or existing object.

virtual OSB_LIB::NumberAnalyzer::~NumberAnalyzer (  )  [inline, virtual]

Virtual destructor.

Definition at line 117 of file numberanalyzer.h.


Member Function Documentation

virtual bool OSB_LIB::NumberAnalyzer::analyzeCalled ( NwAddress nwAddress  )  const [pure virtual]

Analyze the called number.

Returns:
true if further analysis on the called number is needed.

Implemented in OSB_LIB::NumberAnalyzer01.

virtual bool OSB_LIB::NumberAnalyzer::analyzeCalling ( NwAddress nwAddress  )  const [pure virtual]

Analyze the calling number.

Returns:
true if further analysis on the calling number is needed.

Implemented in OSB_LIB::NumberAnalyzer01.

AutoPtr OSB_LIB::NumberAnalyzer::clone (  )  const

Virtual copy constructor.

For details see quality manual, implementation patterns.

virtual NumberAnalyzer* OSB_LIB::NumberAnalyzer::clone_ (  )  const [private, pure virtual]

Virtual copy construction.

For details see quality manual, implementation patterns.

Implemented in OSB_LIB::NumberAnalyzer01.

void OSB_LIB::NumberAnalyzer::insert ( const OSB_DB::Session session  )  [private]

Create a new number analyzer object in database.

This function inserts a newly created number analyzer object into database. Upon successful insertion, an unique id will be generated. This unique id will be populated into the newly created object.

Parameters:
session Database session to be used.
Exceptions:
If the number analyzer is assigned to a trunk group that already owns a number analyzer.

virtual void OSB_LIB::NumberAnalyzer::insSpecific ( const OSB_DB::Session session  )  [private, pure virtual]

Insert derieve class specific data into database.

Parameters:
session Database session used.

Implemented in OSB_LIB::NumberAnalyzer01.

template<typename T>
const T * OSB_LIB::NumberAnalyzer::isa ( const T *&  ptr  )  const

Downcasting: see template<typename T> T* isa(T*&).

Definition at line 432 of file numberanalyzer.h.

template<typename T>
T * OSB_LIB::NumberAnalyzer::isa ( T *&  ptr  ) 

Downcast to a derived class.

The function uses dynamic_cast<T*> to downcast an object of RatingFn to an object of a derived class.

          ptr = dynamic_cast<T*>(this);
          return ptr;

An example is given below:

          class DerievedNumAnalyzer : public NumberAnalyzer {
              ....
          };

          void foo (const NumberAnalyzer& na)
          {
              ...
              DerievedNumAnalyzer* ptr;
              if (0 != na.isa(ptr)) {
                  // work with ptr...
              }
          }

Parameters:
ptr Pointer to cast to. It gets the result of the downcast. It's value will be 0 if the cast fails.
Returns:
The argument pointer 'ptr' after the downcast.

Definition at line 425 of file numberanalyzer.h.

static NumberAnalyzerType OSB_LIB::NumberAnalyzer::numberAnalyzerType ( const long  type  )  [static]

Convert integer to its number analyzer type representation.

static long OSB_LIB::NumberAnalyzer::numberAnalyzerType ( const NumberAnalyzerType type  )  [static]

Convert number analyzer type to its integer representation.

const Oid& OSB_LIB::NumberAnalyzer::oid (  )  const

Get the object id of the number analyzer object.

virtual NumberAnalyzer& OSB_LIB::NumberAnalyzer::operator= ( const NumberAnalyzer rhs  )  [protected, virtual]

Assignment operator.

Remarks:
The operator is protected in order to avoid partial assignments of derived classes through pointers or references to the base class.

bool OSB_LIB::NumberAnalyzer::read ( const OSB_DB::Session session  ) 

Populate data members with info in database.

This function allows a number analysis object to read the latest info from database and populate itself. The number analyzer object must contain object id. All other data members will be overwritten with the data fetched from database.

Parameters:
session Database session to be used.
Returns:
true if operation completed successfully. It return false if the object id is not found in database.

virtual bool OSB_LIB::NumberAnalyzer::readSpecific ( const OSB_DB::Session session  )  [private, pure virtual]

Populate the derieved class data members.

Parameters:
session Database session used.
Returns:
true if operation completed successfully. It return false if the object id is not found in database.

Implemented in OSB_LIB::NumberAnalyzer01.

void OSB_LIB::NumberAnalyzer::remove ( const OSB_DB::Session session  )  [private]

Remove an existing number analyzer object from database.

This function allow the number analyzer to remove/delete itself from database. On successful deletion, the unique id of the object itself will be unset.

The function will not return or throw any errors if the number analyzer to be deleted does not exist in database.

Parameters:
session Database session to be used.
Exceptions:
OsbException if the object version of the number analyzer is not the same as the data in database.

virtual void OSB_LIB::NumberAnalyzer::removeSpecific ( const OSB_DB::Session session  )  [private, pure virtual]

Delete derieve class specific data from database.

Parameters:
session Database session used.

Implemented in OSB_LIB::NumberAnalyzer01.

const NumberAnalyzerType& OSB_LIB::NumberAnalyzer::type (  )  const

Get the type of number analyzer.

void OSB_LIB::NumberAnalyzer::update ( const OSB_DB::Session session  )  [private]

Update an existing number analyzer object in database.

This function allow the number analyzer to update itself in database. The data in database will be overwritten with the data in the object.

Parameters:
session Database session to be used.
Exceptions:
OsbException if:
  • Object version in database differs.
  • Number analyzer with the specified object id does not exist in database.

virtual void OSB_LIB::NumberAnalyzer::updSpecific ( const OSB_DB::Session session  )  [private, pure virtual]

Update derieved class specific data in database.

Parameters:
session Database session used.

Implemented in OSB_LIB::NumberAnalyzer01.


Friends And Related Function Documentation

friend class NetworkElement [friend]

Network element needs to invoke its private functions.

Definition at line 75 of file numberanalyzer.h.

friend class OSB_DB::NumberAnalyzerGw [friend]

Allow gateway to access and populate its data members.

Definition at line 79 of file numberanalyzer.h.

friend class TrunkGroup [friend]

Trunk group needs to invoke its private functions.

Definition at line 77 of file numberanalyzer.h.


Member Data Documentation

Oid OSB_LIB::NumberAnalyzer::oid_ [private]

Unique id of the number analysis object.

Definition at line 306 of file numberanalyzer.h.

NumberAnalyzerType OSB_LIB::NumberAnalyzer::type_ [private]

Type of number analyzer.

Definition at line 309 of file numberanalyzer.h.


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