OSB_LIB::FilterCond Class Reference

Inheritance diagram for OSB_LIB::FilterCond:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Conditions for the filter.

This is the leaf element of the filter expression. This is the base class which contains the object id to identify the filter condition and the filter type (e.g. ftServiceClass,ftTariffClass). It contains the function eval to evaluate the filter condition. This will apply the operator on the target id and the element in the usedservice and return the result.

(e.g. usedservice.serviceClass == targetId)

Definition at line 326 of file filter.h.

Database operations:

Public Types

Public Member Functions

Read access to data members.
Modify access to data members.

Private Member Functions

Specific database operations for derived class.
The following functions are used to perform derived class specific database operations. For those derived classses that do not have any specific database operation will implement the function to return true.

Status changes.
Specific checking before status changes.
These are pure virtual functions which is implemented in the derived class to check the requirement before changing the status. If the derived class doesn't have any checking then it should return true.

Private Attributes

Friends


Member Typedef Documentation

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

Auto pointer to filter condition.

Reimplemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

Definition at line 344 of file filter.h.

typedef Id<FilterCond> OSB_LIB::FilterCond::Oid

Unique object id for the filter condition.

Definition at line 341 of file filter.h.


Constructor & Destructor Documentation

OSB_LIB::FilterCond::FilterCond ( const Oid oid = Oid()  ) 

Constructor with oid.

Parameters:
oid Unique id of the filter condition object.

OSB_LIB::FilterCond::FilterCond ( const Oid oid,
const FilterType  ft 
)

Constructor with full info.

Parameters:
oid Unique id of the filter condition object.
ft Type of Filter.

virtual OSB_LIB::FilterCond::~FilterCond (  )  [virtual]

Empty virtual destructor.


Member Function Documentation

AutoPtr OSB_LIB::FilterCond::clone (  )  const

"Virtual" copy constructor.

Create a newly allocated copy of the filter condition by calling the protected/private member function clone_():

          FilterCond::AutoPtr FilterCond::clone() const
          {
              return AutoPtr(clone_());
          }
Attention:
Classes derived from FilterCond that overwrite clone() MUST implement the function as shown above: The behaviour of the function must not change if called through a reference/pointer of the base or derived class!
All derived classes should overwrite this function returning an auto_ptr of their own type. This pattern allows clients to copy-create a TCS version and prevent memory leaks:
          class Derived : public Base {
          public:
              type std::auto_ptr<Derived> AutoPtr;
              AutoPtr clone() const;
          };

          void b(const Base& b)
          {
              Base::AutoPtr ab = b.clone();
              // Do on ab whatever operations are defined by Base.
          }

          void d(const Derived& d)
          {
              Derived::AutoPtr ad = d.clone();
              // Do on ad whatever is defined for Derived.
          }

Returns:
An auto_ptr to the filter condition.

Reimplemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

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

Abstract virtual constructor.

Create a copy of the filter condition: Allocate memory and initialize it with the current object. Clients of the class use the public member clone(), that returns an auto_ptr of the appropriate filter condition.

Classes that directly or indirectly inherit from FilterCond should redeclare or define this member function:

Returns:
A pointer to the new allocated copy of the filter condition.
Remarks:
The return type for derived classes should be <Derived>*

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

virtual bool OSB_LIB::FilterCond::eval ( const Cdr cdr,
const UsedService us 
) [pure virtual]

Evaluate the Cdr, UsedService.

This will evaluate the usedservice using operator and the target value. If it matches the function will return true else false. (e.g. filter condition is serviceclass == 8. operator is otEqualTo, filter type service class, target id is 8. If the usedservice contains the serviceclass id as 8 then this function will return true for this example).

Parameters:
cdr Cdr object to use.
us UsedService in the cdr object for evaluation.
Returns:
True if the given used service matches with the target value else false.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

bool OSB_LIB::FilterCond::freeze ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private]

Set the status from editable to standby.

In order to set the status from editable to standby, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container of error messages if any.
Exceptions:
OsbException for any database errors.
Returns:
True if status changed to standby else false.

virtual bool OSB_LIB::FilterCond::freezeSpecific ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private, pure virtual]

Criteria checking before setting the status from editable to standby.

Parameters:
session Database session to use.
errors Container for error messages if any.
Returns:
True if all criteria satisfied else false.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

FilterType OSB_LIB::FilterCond::fType (  )  const

Return the type of filter.

bool OSB_LIB::FilterCond::insert ( const OSB_DB::Session session  )  [private]

Insert the filter condition into the database.

This will insert the new filter condition object into the database using filter condition gateway.

Parameters:
session Database session to use.
Exceptions:
Exception on database errors.
Returns:
True if filter condition object inserted successfully else false.

virtual bool OSB_LIB::FilterCond::insSpecific ( const OSB_DB::Session session  )  [private, pure virtual]

Insert derived class specific data members into database.

Parameters:
session Database session to use.
Exceptions:
Exception on database errors.
Returns:
True if the data members inserted successfully else false.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

bool OSB_LIB::FilterCond::isReleased ( const OSB_DB::Session session  ) 

Checks the configured objects are released.

This will check the local objects, filter condition, left and right hand side filter expressions are released then it will return true else false.

Returns:
True if the objects are released else false.

long OSB_LIB::FilterCond::objVs (  )  const

Return the object version.

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

Return the unique id of the filter condition.

virtual void OSB_LIB::FilterCond::print (  )  [pure virtual]

This is for debugging purpose.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

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

Read the filter condition from the database.

This will read the filter condition from the database using filter condition gateway. Before calling this function the object id should be set because the object id is the primary key to get the filter condition object.

Parameters:
session Database session to use.
Exceptions:
Exception for the following:
  • Object not found
Returns:
True if the filter condition object read successfully else false.

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

Read derived class specific data members from database.

Parameters:
session Database session to use.
Exceptions:
Exception if object not found.
Returns:
True if read the data members successfully else false.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

bool OSB_LIB::FilterCond::release ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private]

Set the status from standby to release.

In order to set the status from standby to release, the following criteria must be fulfilled:

Parameters:
session Database session to use.
errors Container of error messages if any.
Exceptions:
OsbException for any database errors.
Returns:
True if status changed to release else false.

const Date& OSB_LIB::FilterCond::releaseDate (  )  const

Return the release date of the object.

virtual bool OSB_LIB::FilterCond::releaseSpecific ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private, pure virtual]

Criteria checking before setting the status from standby to release.

Parameters:
session Database session to use.
errors Container for error messages if any.
Returns:
True if all criteria satisfied else false.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

bool OSB_LIB::FilterCond::remove ( const OSB_DB::Session session  )  [private]

Remove the filter condition from the database.

This will remove the filter condition object from the datebase using filter condition gateway. The filter condition object is identified using filter condition id.

Parameters:
session Database session to use.
Exceptions:
Exception for the following errors:
  • Object not found.
  • Foreign key violation.
Returns:
True if filter condition object removed successfully else false.

virtual bool OSB_LIB::FilterCond::removeSpecific ( const OSB_DB::Session session  )  [private, pure virtual]

Remove derived class specific data members from the database.

Parameters:
session Database session to use.
Exceptions:
Exception if object not found.
Returns:
true if success else false.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

bool OSB_LIB::FilterCond::revoke ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private]

Set the status from release to standby.

In order to get the status from release to standby, the following criteria must be fulfilled: Object must be in status released

Parameters:
session Database session to use.
errors Container of error messages is any.
Exceptions:
OsbException for any database errors.
Returns:
True if status changed to standby else false.

virtual bool OSB_LIB::FilterCond::revokeSpecific ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private, pure virtual]

Criteria checking before setting the status from release to standby.

Parameters:
session Database session to use.
errors Container for error messages if any.
Returns:
True if all criteria satisfied else false.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

bool OSB_LIB::FilterCond::setReleaseDate ( const Date date  ) 

Set the release date.

CfgStatus OSB_LIB::FilterCond::status (  )  const

Return the status of the object.

bool OSB_LIB::FilterCond::unfreeze ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private]

Set the status from standby to editable.

In order to get the status from standby to editable, the following criteria must be fulfilled: Object must be in status standby

Parameters:
session Database session to use.
errors Container of error messages is any.
Exceptions:
OsbException for any database errors.
Returns:
True if status changed to editable else false.

virtual bool OSB_LIB::FilterCond::unfreezeSpecific ( const OSB_DB::Session session,
std::vector< OsbError > &  errors 
) [private, pure virtual]

Criteria checking before setting the status from standby to editable.

Parameters:
session Database session to use.
errors Container for error messages if any.
Returns:
True if all criteria satisfied else false.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

bool OSB_LIB::FilterCond::update ( const OSB_DB::Session session  )  [private]

Update the filter condition in the database.

This will update the filter condition object with the current values using filter condition gateway. The filter condition object is identified using filter condition id.

Parameters:
session Database session to use.
Exceptions:
Exception if object not found.
Returns:
True if filter condition object updated successfully else false.

virtual bool OSB_LIB::FilterCond::updSpecific ( const OSB_DB::Session session  )  [private, pure virtual]

Update derived class specific data members in the database.

Parameters:
session Database session to use.
Exceptions:
Exception if object not found.
Returns:
True if the data members updated successfully else false.

Implemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.


Friends And Related Function Documentation

friend class FilterManager [friend]

This is used to configure and manage the objects.

Reimplemented in OSB_LIB::ScFilter, and OSB_LIB::TcFilter.

Definition at line 337 of file filter.h.

friend struct OSB_DB::FilterCondGw [friend]

This will perform all the database operation for FilterCond.

Definition at line 332 of file filter.h.


Member Data Documentation

FilterType OSB_LIB::FilterCond::ft_ [private]

Type of Filter (e.g. ftServiceClass, ftTariffClass etc).

Definition at line 756 of file filter.h.

long OSB_LIB::FilterCond::objVs_ [private]

Object version to ensure the object in the database and the object in the system are same.

Definition at line 762 of file filter.h.

Oid OSB_LIB::FilterCond::oid_ [private]

Unique object identifier for filter condition.

Definition at line 753 of file filter.h.

Date OSB_LIB::FilterCond::releaseDate_ [private]

Release date of this filter version object.

Definition at line 768 of file filter.h.

CfgStatus OSB_LIB::FilterCond::status_ [private]

Status of the object.

Definition at line 765 of file filter.h.


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