Filter expression can be expressed as filtercond, !filterexpr, (filterexpr), filterexpr && filterexpr, filterexpr || filterexpr, filterexpr ^ filterexpr.
e.g. serviceClass == 8 && tariffClass != 9 serviceClass == 8 is a filter condition (id - 1) mapped to the filter expression e1. tariffClass != 9 is a filter condition (id - 2) mapped to the filter expression e2. e3 = e1 && e2 For e3 left hand side filter expression is e1, right hand side filter expression is e2 and the operator is otAnd. For e1 filter condition id is 1 and the left, right hand side filter expression id is null. For e2 filter condition id is 2 and the left, right hand side filter expression id is null. e3 is the starting point of the example filter expression.
It contains the function eval to evaluate the filter expression. If the filter expression contains the left or right hand side expressions then it will apply the operator on the expressions else it will evaluate the filter condition.
Definition at line 898 of file filter.h.
typedef Id<FilterExpr> OSB_LIB::FilterExpr::Oid |
OSB_LIB::FilterExpr::FilterExpr | ( | const FilterExpr::Oid & | oid = Oid() |
) |
Constructor with Oid.
This constructor is used as default constructor as well as constructor with oid to construct the filter expression object.
oid | Unique id of the filter expression object. |
OSB_LIB::FilterExpr::FilterExpr | ( | const Oid & | oid, | |
const FilterCond::Oid & | fcId, | |||
const FilterExpr::Oid & | lhsfeId, | |||
const FilterExpr::Oid & | rhsfeId, | |||
OperatorType | op = otUnknown | |||
) |
Constructor with all info.
oid | Unique id of the filter expression object. | |
fcId | Filter Condition id. | |
lhsfeId | Left hand side filter expression id. | |
rhsfeId | Right hand side filter expression id. | |
op | Operator Type to be used to evaluate the expression. |
OSB_LIB::FilterExpr::~FilterExpr | ( | ) |
Destructor to destruct all the dynamically created objects.
This is used to destruct all the objects created dynamically.
OSB_LIB::FilterExpr::FilterExpr | ( | FilterExpr & | rhs | ) |
Constructor with reference to the filter expression object.
This will copy the filter expression attributes and all the internal objects.
rhs | Filter expression to use. |
OSB_LIB::FilterExpr::FilterExpr | ( | const FilterExpr & | rhs | ) |
Copy constructor to copy all the internal objects.
This will copy the filter expression attributes and all the internal objects.
rhs | Filter expression to use. |
void OSB_LIB::FilterExpr::build | ( | ) |
Build this filter expression.
This will create the left hand side, right hand side filter expressions or filter condition according to the mapping to this filter expression.
bool OSB_LIB::FilterExpr::eval | ( | const Cdr & | cdr, | |
const UsedService & | us | |||
) |
Evaluation of Cdr, UsedService.
This will evaluate the given Cdr and UsedService with the configured filter expressions and filter condition and returns the result.
cdr | Cdr object for evaluation. | |
us | UsedService in the cdr object for evaluation. |
const FilterCond::Oid& OSB_LIB::FilterExpr::fcId | ( | ) | const |
Return the condition id mapped to this filter expression.
bool OSB_LIB::FilterExpr::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:
session | Database session to use. | |
errors | Container of error messages if any. |
OsbException | for any database errors. |
bool OSB_LIB::FilterExpr::insert | ( | const OSB_DB::Session & | session | ) | [private] |
Insert the filter expression into the database.
This will insert the filter expression into the database using filter expression gateway. The object id will be set for this object only after the insertion.
session | Database session to use. |
Exception | if error in database. |
bool OSB_LIB::FilterExpr::isReleased | ( | const OSB_DB::Session & | session | ) |
Checks the object is released.
This will check the status, if the status is released then it will return true else false.
const Oid& OSB_LIB::FilterExpr::lhsfeId | ( | ) | const |
Return the left hand side filter expression id mapped to this filter expression.
long OSB_LIB::FilterExpr::objVs | ( | ) | const |
Return the object version.
const Oid& OSB_LIB::FilterExpr::oid | ( | ) | const |
Return the object id of this filter expression.
OperatorType OSB_LIB::FilterExpr::optype | ( | ) | const |
Returns the operator type to evaluate the expression.
void OSB_LIB::FilterExpr::print | ( | ) |
This is for debugging purpose.
bool OSB_LIB::FilterExpr::read | ( | const OSB_DB::Session & | session | ) |
Read the filter expression from the database.
This is used to read the filter expression from the database using filter expression gateway. Before fetching from the database the object id should be set. Object id is used to identify the object.
session | Database session to use. |
Exception | if object not found. |
bool OSB_LIB::FilterExpr::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:
session | Database session to use. | |
errors | Container of error messages if any. |
OsbException | for the following errors:
|
const Date& OSB_LIB::FilterExpr::releaseDate | ( | ) | const |
Return the release date of the object.
bool OSB_LIB::FilterExpr::remove | ( | const OSB_DB::Session & | session | ) | [private] |
Remove the filter expression from the database.
This will remove the filter expression from the database using filter expression gateway. The object id is used to identify the object for deletion.
session | Database session to use. |
Exception | for the following errors:
|
bool OSB_LIB::FilterExpr::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:
session | Database session to use. | |
errors | Container of error messages is any. |
OsbException | for any database errors. |
const Oid& OSB_LIB::FilterExpr::rhsfeId | ( | ) | const |
Return the right hand side filter expression id mapped to this filter expression.
bool OSB_LIB::FilterExpr::setFcId | ( | const FilterCond::Oid & | fcId | ) |
Set the filter condition id.
bool OSB_LIB::FilterExpr::setLhsFeId | ( | const Oid & | lhsId | ) |
Set the left hand side filter expression id.
bool OSB_LIB::FilterExpr::setOperator | ( | OperatorType | op | ) |
Set the operator.
bool OSB_LIB::FilterExpr::setReleaseDate | ( | const Date & | date | ) |
Set the release date.
bool OSB_LIB::FilterExpr::setRhsFeId | ( | const Oid & | rhsId | ) |
Set the right hand side filter expression id.
CfgStatus OSB_LIB::FilterExpr::status | ( | ) | const |
Return the status of the object.
bool OSB_LIB::FilterExpr::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:
session | Database session to use. | |
errors | Container of error messages is any. |
OsbException | for any database errors. |
bool OSB_LIB::FilterExpr::update | ( | const OSB_DB::Session & | session | ) | [private] |
Update the filter expression in the database.
This will update the filter expression in the database with the current value using filter expression gateway. The object id is used to identify the object for updation.
session | Database session to use. |
Exception | if object not found. |
friend class FilterManager [friend] |
friend struct OSB_DB::FilterExprGw [friend] |
FilterCond* OSB_LIB::FilterExpr::fc_ [private] |
FilterCond::Oid OSB_LIB::FilterExpr::fcId_ [private] |
Filter condition which is mapped to this filter expression. All the leaf node filter expressions are mapped to any one of the FilterCond otherwise its empty.
FilterExpr* OSB_LIB::FilterExpr::lhsfe_ [private] |
FilterExpr::Oid OSB_LIB::FilterExpr::lhsfeId_ [private] |
long OSB_LIB::FilterExpr::objVs_ [private] |
Oid OSB_LIB::FilterExpr::oid_ [private] |
OperatorType OSB_LIB::FilterExpr::op_ [private] |
Date OSB_LIB::FilterExpr::releaseDate_ [private] |
FilterExpr* OSB_LIB::FilterExpr::rhsfe_ [private] |
FilterExpr::Oid OSB_LIB::FilterExpr::rhsfeId_ [private] |
CfgStatus OSB_LIB::FilterExpr::status_ [private] |