OSB_LIB::DeviceItem Class Reference

Inheritance diagram for OSB_LIB::DeviceItem:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Devices as part of products.

Definition at line 61 of file deviceitem.h.

Public Types

Public Member Functions

Static Public Attributes

Private Member Functions

Private Attributes


Member Typedef Documentation

typedef std::auto_ptr<DeviceItem> OSB_LIB::DeviceItem::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 66 of file deviceitem.h.

typedef TypeId<Device> OSB_LIB::DeviceItem::DvcType

Short-hand for a device type.

Definition at line 68 of file deviceitem.h.


Constructor & Destructor Documentation

OSB_LIB::DeviceItem::DeviceItem ( const Oid oid,
const std::string &  name = "",
const std::string &  des = "" 
) [explicit]

Constructor with object id, name and description.


Member Function Documentation

CfgType OSB_LIB::DeviceItem::canConfigure (  )  const [virtual]

Configuration is mandatory.

Implements OSB_LIB::ProductItem.

DefPersType OSB_LIB::DeviceItem::canDefPers (  )  const [virtual]

Default personalization not possible.

Implements OSB_LIB::ProductItem.

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

Personalization is mandatory.

Implements OSB_LIB::ProductItem.

AutoPtr OSB_LIB::DeviceItem::clone (  )  const

Virtual copy construction.

For details see quality manual, implementation patterns.

Reimplemented from OSB_LIB::ProductItem.

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

Virtual copy construction.

For details see quality manual, implementation patterns.

Implements OSB_LIB::ProductItem.

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

Create the personalized device item.

Returns:
A device item as determined by dvcType_;

Implements OSB_LIB::ProductItem.

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

Default personalization not possible: return 0.

Implements OSB_LIB::ProductItem.

bool OSB_LIB::DeviceItem::delSpecific ( const OSB_DB::Session session  )  [private, 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.

Implements OSB_LIB::ProductItem.

DvcType OSB_LIB::DeviceItem::deviceType (  )  const

Set the supported device type.

bool OSB_LIB::DeviceItem::insSpecific ( const OSB_DB::Session session  )  [private, 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.

Implements OSB_LIB::ProductItem.

bool OSB_LIB::DeviceItem::readSpecific ( const OSB_DB::Session session  )  [private, 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.

Implements OSB_LIB::ProductItem.

void OSB_LIB::DeviceItem::setDeviceType ( const DvcType  dvcType  ) 

Set the supported device type.

Parameters:
dvcType The new device for the item.
Exceptions:
OsbException if dvcType is not valid.

Type OSB_LIB::DeviceItem::type (  )  const [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.

bool OSB_LIB::DeviceItem::updSpecific ( const OSB_DB::Session session  )  [private, 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.

Implements OSB_LIB::ProductItem.


Member Data Documentation

DvcType OSB_LIB::DeviceItem::dvcType_ [private]

The device type for which to create a pers. product item.

Definition at line 155 of file deviceitem.h.

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

Type id of the class: PiType::piDevice.

Definition at line 64 of file deviceitem.h.


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