OSB_LIB::Filter Class Reference

Collaboration diagram for OSB_LIB::Filter:

Collaboration graph
[legend]
List of all members.

Detailed Description

Used to identify the filter.

This will act as a tag class to identify the filter. It contains filterId, name of the filter, description for the filter and the object version. By using filter id we can identify the filter and object version is used to ensure that the object in the database and the object in the system are same.

Definition at line 129 of file filter.h.

Database operations:

Public Types

Public Member Functions

Modify data members:
Read access to data members:

Private Attributes

Friends


Member Typedef Documentation

typedef Id<Filter> OSB_LIB::Filter::Oid

Unique object identifier for filter.

Definition at line 143 of file filter.h.


Constructor & Destructor Documentation

OSB_LIB::Filter::Filter ( const std::string &  name,
const std::string &  des 
)

This is an utility constructor used to construct the filter using name and description.

Parameters:
name Name of the filter.
des Description of the filter.

OSB_LIB::Filter::Filter ( const Oid oid = Oid(),
const long objVs = 0,
const std::string &  name = "",
const std::string &  des = "" 
)

Constructor with all info.

This constructor will be used as an default constructor to construct the filter as well as we can construct with full information.

Parameters:
oid Unique identification of the filter.
objVs Object version.
name Name of the filter.
des Description of the filter.


Member Function Documentation

const std::string& OSB_LIB::Filter::des (  )  const

Return the description of the filter.

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

Insert the filter into database.

This will insert the new filter into the database using filter gateway. The object should contain the name and the description before insertion. The unique object id and the object version will be assigned to this object after insertion.

Parameters:
session Database session to use.
Exceptions:
Exception for the folloing errors:
  • Unique key violation.
  • Name field is empty.
  • Name exceeds maximum size.
  • Description exceeds maximum size.
Returns:
True if the filter inserted successfully else false.

const std::string& OSB_LIB::Filter::name (  )  const

Return the name of the filter.

long OSB_LIB::Filter::objVs (  )  const

Return the object version of the filter.

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

Return the object id of the filter.

void OSB_LIB::Filter::print (  ) 

It is used for debugging purpose.

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

Read the filter from database.

This will read the filter information from the database using filter gateway. The object id is used to identify the filter.

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

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

Remove the filter from database.

This will remove the filter from database using filter gateway. The object id is used to identify the filter object to remove from the database.

Parameters:
session Database session to use.
Exceptions:
For the following errors:
  • Object not found.
  • Foreign key constraint.
Returns:
True if the filter removed successfully else false.

bool OSB_LIB::Filter::setDes ( const std::string &  des  ) 

Set the description of the filter.

Parameters:
des Description of the filter.
Exceptions:
Exception for the following errors:
  • Object is not editable.
  • New description is too long.

bool OSB_LIB::Filter::setName ( const std::string &  name  ) 

Set the name of the filter.

Parameters:
name Name of the filter.
Exceptions:
Exception for the following errors:
  • Object is not editable.
  • New name is too long.
  • New name is empty.

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

Update the filter in database.

This will update the filter with the available values using filter gateway. The object id and object version are used to identify the filter object for updation. Object version will be increased by 1.

Parameters:
session Database session to use.
Exceptions:
Exception for the following errors:
  • Object not found.
  • Unique key violation.
  • Name field is empty.
  • Name exceeds maximum size.
  • Description exceeds maximum size.
Returns:
True if the filter updated successfully else false.


Friends And Related Function Documentation

friend class FilterManager [friend]

This is used to manage the filter operations.

Definition at line 139 of file filter.h.

friend struct OSB_DB::FilterGw [friend]

This will perform all database operation for filter.

Definition at line 135 of file filter.h.


Member Data Documentation

std::string OSB_LIB::Filter::des_ [private]

Description of the filter.

Definition at line 305 of file filter.h.

std::string OSB_LIB::Filter::name_ [private]

Name of the filter.

Definition at line 302 of file filter.h.

long OSB_LIB::Filter::objVs_ [private]

Object version, this is used to ensure that the object in the database and the object in the system are same.

Definition at line 299 of file filter.h.

Oid OSB_LIB::Filter::oid_ [private]

Unique id for the filter.

Definition at line 293 of file filter.h.


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