OSB_LIB::PricelistItem Class Reference

Inheritance diagram for OSB_LIB::PricelistItem:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Product item to select a price list.

This product item stores a list of price lists available for a product, one of the price lists may be marked as the default for personalization.

Remarks:
Copy constructor and assignment by compiler.

Definition at line 75 of file plitem.h.

Public Types

Public Member Functions

Read access to data member:
Modify data members:

Static Public Attributes

Private Member Functions

Database operations
All the database operations on price list items do not commit or rollback the transactions. This is indicated by taking a const OSB_DB::Session as argument.

Private Attributes

Friends


Member Typedef Documentation

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

Short-cut for an auto pointer.

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

Reimplemented from OSB_LIB::ProductItem.

Definition at line 87 of file plitem.h.


Constructor & Destructor Documentation

OSB_LIB::PricelistItem::PricelistItem ( const Oid oid,
const std::string &  name = "",
const std::string &  des = "" 
)

Constructor with object id, name and description.

Parameters:
oid Product item object id.
name Name of the price list item.
des Description of the price list item.

OSB_LIB::PricelistItem::PricelistItem ( const Oid oid,
const std::string &  name,
const std::string &  des,
const Id< Pricelist > &  plId 
)

Constructor with full attribute.

Parameters:
oid Product item object id.
name Name of the price list item.
des Description of the price list item.
plId Object id of price list.


Member Function Documentation

ProductItem::CfgType OSB_LIB::PricelistItem::canConfigure (  )  const [virtual]

The configuration type of price list item: mandatory.

Implements OSB_LIB::ProductItem.

ProductItem::DefPersType OSB_LIB::PricelistItem::canDefPers (  )  const [virtual]

The default personalization type of price list item: none.

Implements OSB_LIB::ProductItem.

CfgPersType OSB_LIB::PricelistItem::canPersonalize (  )  const [virtual]

The personalization type of price list item: none.

Implements OSB_LIB::ProductItem.

AutoPtr OSB_LIB::PricelistItem::clone (  )  const

Virtual copy construction.

For details see quality manual, implementation patterns.

Reimplemented from OSB_LIB::ProductItem.

ProductItem* OSB_LIB::PricelistItem::clone_ (  )  const [private, virtual]

Virtual copy construction.

For details see quality manual, implementation patterns.

Implements OSB_LIB::ProductItem.

std::auto_ptr<PersProductItem> OSB_LIB::PricelistItem::crePersProductItem (  )  const [virtual]

No personalization is availble for this class.

Returns:
The function returns an empty auto pointer.

Implements OSB_LIB::ProductItem.

const PersProductItem* OSB_LIB::PricelistItem::defPersItem (  )  const [virtual]

Pointer to the default personalize product item.

Implements OSB_LIB::ProductItem.

bool OSB_LIB::PricelistItem::delSpecific ( const OSB_DB::Session session  )  [private, virtual]

Delete a price list item from the database.

The function uses a OSB_DB::PricelistItemGw to remove data.

Parameters:
session Database session to use.
Returns:
true if the price list item was found and deleted from the database, else false.

Implements OSB_LIB::ProductItem.

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

Insert a price list item to the database.

The function uses a OSB_DB::PricelistItemGw to insert data member to the database.

Parameters:
session Database session to use.
Returns:
true if the price list item was inserted into the database, else false.

Implements OSB_LIB::ProductItem.

const Id<Pricelist>& OSB_LIB::PricelistItem::plId (  )  const

Retrieve the price list id.

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

(Re)read a price list item from the database.

The function uses a OSB_DB::PricelistItemGw to read the data members.

Parameters:
session Database session to use.
Returns:
Currently always true.

Implements OSB_LIB::ProductItem.

void OSB_LIB::PricelistItem::setPlId ( const Id< Pricelist > &  plId  ) 

Set the price list id.

Type OSB_LIB::PricelistItem::type (  )  const [inline, virtual]

The type of the product item.

The function returns the type of the product item. It is needed for only one reason: Corba clients must provide a configuration window that depends on the actual type.

No appropriate design can be provided: Unless on-line clients use the real product item type through-out the whole live cycle of an object, there must be a way to determine the actual type of a product item. No matter how clever we make our design, for on-line clients there will always be one step where they need to determine a product item's type in a switch-like statement. For this step I personally perfer to work with an enumeration type (and compiler warnings) rather than relying on dynamic casts (where errors can be detected only during run-time).

Remarks:
Derived classes declare the function private.

Implements OSB_LIB::ProductItemBase.

Definition at line 121 of file plitem.h.

References type_.

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

Update a price list item in the database.

The function uses a OSB_DB::PricelistItemGw to update data member in the database.

Parameters:
session Database session to use.
Returns:
true if the price list item was updated in the database, else false.

Implements OSB_LIB::ProductItem.


Friends And Related Function Documentation

friend class OSB_DB::PricelistItemGw [friend]

The database gateway needs to populate data members after construction.

Definition at line 80 of file plitem.h.


Member Data Documentation

Id<Pricelist> OSB_LIB::PricelistItem::plId_ [private]

Object id of price list contained in this price list item.

Definition at line 222 of file plitem.h.

const Type OSB_LIB::PricelistItem::type_ [static]

The product item type id: PiType::piPricelist.

Definition at line 84 of file plitem.h.

Referenced by type().


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