OSB_LIB::ProductItem Class Reference

Inheritance diagram for OSB_LIB::ProductItem:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract base class for all components of a product.

Definition at line 161 of file productitem.h.

Public Types

Public Member Functions

Read access to data members
Modify data members.
Database operations
All database operations on product item do not commit or rollback the transactions.

Protected Member Functions

Protected Attributes

Private Member Functions

Product item type specific database operations.
The functions are used to do product item type specific database operations.

Remarks:
Derived classes that do not need specific database functions return true.
The implementation in derived classes should not commit or rollback the database transactions.

Private Attributes

Friends


Member Typedef Documentation

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

Short-cut for an auto pointer.

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

Reimplemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ResourceItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

Definition at line 179 of file productitem.h.

typedef Id<ProductItem> OSB_LIB::ProductItem::Oid

Typesave object identification, database link.

Definition at line 171 of file productitem.h.


Member Enumeration Documentation

enum OSB_LIB::ProductItem::CfgPersType

Personalization of a product item.

Defines whether it is possible (necessary) to personalize a product item.

Enumerator:
persMandatory  Personalization mandatory.
persOptional  Personalization optional.
persNone  Personalization not possible.

Definition at line 214 of file productitem.h.

enum OSB_LIB::ProductItem::CfgType

Configuration of a product item.

Defines whether it is possible (necessary) to configure a product item.

Enumerator:
cfgMandatory  Configuration mandatory.
cfgOptional  Configuration optional.
cfgNone  Configuration not possible.

Definition at line 187 of file productitem.h.

enum OSB_LIB::ProductItem::DefPersType

Default personalization of a product item.

Defines whether it is possible to default personalize a product item.

Enumerator:
defPersMandatory  Default personalization mandatory.
defPersOptional  Default personalization optional.
defPersNone  Default personalization not possible.

Definition at line 199 of file productitem.h.


Constructor & Destructor Documentation

OSB_LIB::ProductItem::ProductItem ( const Oid oid,
const std::string &  name = "",
const std::string &  desc = "" 
)

Constructor with object id, name and description.

OSB_LIB::ProductItem::ProductItem ( const ProductItem rhs  )  [protected]

Copying for derived classes only.


Member Function Documentation

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

Configuration type of the product item.

The concrete item types will provide the relavant return values. The value return is class specific.

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

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

Default personalization type of the product item.

The concrete item types will provide the relavant return values. The value return is class specific.

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

virtual CfgPersType OSB_LIB::ProductItem::canPersonalize (  )  const [pure virtual]

Personalization type of the product item.

The concrete item types will provide the relavant return values.

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

AutoPtr OSB_LIB::ProductItem::clone (  )  const

Virtual copy construction.

For details see quality manual, implementation patterns.

Reimplemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ResourceItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

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

Virtual copy construction.

For details see quality manual, implementation patterns.

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ResourceItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

const std::string& OSB_LIB::ProductItem::configDes (  )  const [inline]

Description of the product item configuration.

Returns:
The user provided description of the configuration of the product item.
For product items that cannot be configured, the string is empty.

Definition at line 295 of file productitem.h.

References configDes_.

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

Create a PersProductItem.

Creates a personalized product item of the appropriate type. Derived classes that do not support personalization return an empty auto pointer.

Returns:
An auto pointer to a personalized product item, that -if applicable- contains the default personalization.
The id of personalized item will not be set.

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

const std::string& OSB_LIB::ProductItem::defPersDes (  )  const [inline]

Description of the default personalization.

Returns:
The user provided description of the default personalization of the product item.
For product items that cannot be personalized, the string is empty.

Definition at line 304 of file productitem.h.

References defPersDes_.

virtual const PersProductItem* OSB_LIB::ProductItem::defPersItem (  )  const [pure virtual]

Pointer to the default personalize product item.

The concrete item types will provide it.

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

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

Delete type specific entries from the database.

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

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

const std::string& OSB_LIB::ProductItem::desc (  )  const [inline]

Product item description.

Definition at line 258 of file productitem.h.

References des_.

bool OSB_LIB::ProductItem::insert ( const OSB_DB::Session session  ) 

Insert a product item to the database.

The function calls OSB_DB::ProductGw::insProductItem() to store the data members of the base class. If this is successful the virtual function insSpecific() is used to create type specific entries in the database.

Exception savety: The item's object id remains unchanged if the product item was not inserted into the database. This is the case when the function returns false or if an exception is thrown.

Parameters:
session Database session to use.
Exceptions:
OsbException 
  • as specified by the gateway class
  • type specific exceptions out of insSpecific(...).
Returns:
True if the product item was inserted into the database.

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

Insert type specific members to the database.

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

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

const std::string& OSB_LIB::ProductItem::name (  )  const [inline]

Product item name.

Definition at line 256 of file productitem.h.

References name_.

const Oid& OSB_LIB::ProductItem::oid (  )  const [inline]

Object id, database link.

Definition at line 254 of file productitem.h.

References oid_.

ProductItem& OSB_LIB::ProductItem::operator= ( const ProductItem rhs  )  [protected]

Assignment or derived classes only.

virtual std::ostream& OSB_LIB::ProductItem::prInfo ( std::ostream &  os  )  const [virtual]

Print debugging information.

Remarks:
The method is virtual so that derived classes can overwrite it to prodive additional specific information.
Parameters:
os Stream to write to.
Returns:
Reference to argument output stream.

bool OSB_LIB::ProductItem::read ( const OSB_DB::Session session,
bool  baseRead = false 
)

Read a product item from the database.

If not previously done, the function calls OSB_DB::ProductGw::fetch(const Session&, ProductItem&) to read and set the data members of the base class. Afterwards it calls the virtual function readSpecific() to retrieve item type specific member from the database.

Parameters:
session Database session to use.
baseRead Flag if the members of the base class have already been read (from PRODUCT_ITEM).
Exceptions:
OsbException 
  • as specified by the gateway class (see there)
  • type specific exceptions out of readSpecific(...).
Returns:
True if the product item was read from the database.

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

Read type specific data members from database.

Parameters:
session Database session to use.
Returns:
True if the item was found and read from the database, else false.

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.

bool OSB_LIB::ProductItem::remove ( const OSB_DB::Session session  ) 

Delete a product item from the database.

The function first calls the virtual member function delSpecific() to delete data that are specific for a given product item type. In the second step OSB_DB::ProductGw::delProductItem() is called to delete the base part of the product item.

On successful deletion, the item's object id is unset to indicate that the product item does no more exist in the database.

Parameters:
session Database session to use.
Exceptions:
OsbException 
  • as specified by the gateway class
  • type specific exceptions out of delSpecific(...).
Returns:
True if the product item was found and deleted from the database.

bool OSB_LIB::ProductItem::setConfigDes ( const std::string &  configDes  ) 

User provided description of the configuration.

The method returns false if the product item cannot be configured (as determined by canConfigure()).

bool OSB_LIB::ProductItem::setDefPersDes ( const std::string &  defPersDes  ) 

User provided description of the default personalization.

The method returns false if the product item cannot be default personalized (as determined by canDefPers()).

void OSB_LIB::ProductItem::setDesc ( const std::string &  desc  ) 

Set the description of the product item.

void OSB_LIB::ProductItem::setName ( const std::string &  name  ) 

Set the product item name.

bool OSB_LIB::ProductItem::update ( const OSB_DB::Session session  ) 

Update a product item in the database.

The function first uses OSB_DB::ProductGw::updProductItem() to update the members of the base class and -in case of success- calls the virtual member function updSpecific() to update item type specific data members.

Parameters:
session Database session to use.
Exceptions:
OsbException 
  • as specified by the gateway class
  • type specific exceptions out of updSpecific(...).
Returns:
True if the product item was found and updated in the database.

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

Update type specific members in the database.

Parameters:
session Database session to use.
Returns:
True if the item was found and updated in the database, else false.

Implemented in OSB_LIB::AnItem, OSB_LIB::CallingCardItem, OSB_LIB::CreditItem, OSB_LIB::DeviceItem, OSB_LIB::E164Item, OSB_LIB::IpGroupItem, OSB_LIB::PricelistItem, OSB_LIB::DescriptionItem, OSB_LIB::ServiceItem, OSB_LIB::TrunkItem, and OSB_LIB::TariffSystemItem.


Friends And Related Function Documentation

friend class OSB_DB::ProductGw [friend]

The database gateway needs to populate data members after construction of the correct empty type. ToDo: Provide support for object version.

Definition at line 167 of file productitem.h.


Member Data Documentation

std::string OSB_LIB::ProductItem::configDes_ [protected]

Configuration as string.

Definition at line 513 of file productitem.h.

Referenced by configDes().

std::string OSB_LIB::ProductItem::defPersDes_ [protected]

Default personalization as string.

Definition at line 515 of file productitem.h.

Referenced by defPersDes().

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

Description of product item.

Definition at line 510 of file productitem.h.

Referenced by desc().

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

Name of product item.

Definition at line 509 of file productitem.h.

Referenced by name().

Oid OSB_LIB::ProductItem::oid_ [private]

Unique id, database link.

Definition at line 508 of file productitem.h.

Referenced by oid().


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