OSB_LIB::EditStatus Class Reference

Collaboration diagram for OSB_LIB::EditStatus:

Collaboration graph
[legend]
List of all members.

Detailed Description

Edit status of objects.

The edit status reflects the editing state of the objects. It is useful in hierarchy structures such as product and its nodes. (E.g. When a node is modified, its edit status is set to esModified. When we want to commit the changes made to the product (and its nodes), we check the edit status of the nodes and perform the necessary actions.

Definition at line 67 of file osbutils.h.

Public Types

Public Member Functions

Private Member Functions

Private Attributes


Member Enumeration Documentation

enum OSB_LIB::EditStatus::Status

Enumeration for possible status.

Enumerator:
esUnchanged  Object is unchanged. No database operation needed.
esModified  Object is edited. Needs to update to database.
esCreated  Object is newly created. Needs to insert into database.
esDeleted  Object is deleted. Needs to delete from database.

Definition at line 70 of file osbutils.h.


Constructor & Destructor Documentation

OSB_LIB::EditStatus::EditStatus ( Status  status = esUnchanged  ) 

Implicit constructor with optional status.


Member Function Documentation

bool OSB_LIB::EditStatus::changesDiscarded (  ) 

Set the edit status to esUnchanged.

Call this method to discard changes made to an object.

This method returns true only if the current status is esUnchanged or esModified. This is because:

Returns:
True if the status is set, false otherwise.
Remarks:
It is the responsibility of the objects to reload their members with the original values.

bool OSB_LIB::EditStatus::setCreated (  ) 

Set the edit status to esCreated.

Call this method when creating new objects that needs to be inserted to the database.

Be careful when calling this method:

Returns:
Always true.

bool OSB_LIB::EditStatus::setDeleted (  ) 

Set the edit status to esDeleted.

Call this method to mark the object for deletion from the database.

Returns:
This method is always returns true.

bool OSB_LIB::EditStatus::setModified (  ) 

Set the edit status to esModified.

Call this method when member attributes of the object are modified.

This method returns true only if the current status is esUnchanged or esModified. This is because:

Returns:
True if the status is set, false otherwise.

bool OSB_LIB::EditStatus::setRead (  )  const

Set the edit status to esUnchanged.

Call this method ONLY when constructing objects in the gateways.

The method returns true only if the current status is esUnchanged. This is because:

Returns:
True if the status is set, false otherwise.

bool OSB_LIB::EditStatus::setUndeleted (  ) 

Set the edit status to the previous status.

Call this method to undelete an object (that was marked for deleting via setDeleted()).

Returns:
This method always return true.

Status OSB_LIB::EditStatus::status (  )  const

Returns the edit status.

Referenced by OSB_LIB::OnetimeCharge::editStatus().

Status OSB_LIB::EditStatus::toStatus ( int  value  )  const [private]

Converts integer value to status enum.


Member Data Documentation

int OSB_LIB::EditStatus::status_ [private]

The edit status of the object.

Definition at line 180 of file osbutils.h.


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