OSB_LIB::PersDevice Class Reference

Inheritance diagram for OSB_LIB::PersDevice:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Devices as subscribed product part.

Definition at line 161 of file deviceitem.h.

Public Types

Public Member Functions

Access to the assigned device:
NOTE to the developpers: add wrappers to the assigned device as needed, but be sure to pay attention to the fact that the pointer to the assigned device may be 0!
E.g., dvcId() returns an object and not a const reference because of this.

Protected Member Functions

Database operations:
Database operations on a personalized device only make sense if a Device is assigned:
The operations do not only maintain the link table PERS_ITEM, but also the respective entry in DEVICE.

Remember that derived classes have to implement the pure virtual I/O operations required by PersProductItem, e.g., readSpecific(). For this they preferably use the database methods of this base class.

Private Member Functions


Member Typedef Documentation

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

Short-cut for an auto pointer.

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

Reimplemented from OSB_LIB::PersProductItem.

Reimplemented in OSB_LIB::PersUimCard.

Definition at line 164 of file deviceitem.h.


Constructor & Destructor Documentation

OSB_LIB::PersDevice::PersDevice ( const Oid oid = Oid()  )  [explicit]

Constructor with optional object id.

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

Copying for derived classes only.


Member Function Documentation

virtual bool OSB_LIB::PersDevice::changeAssignTs ( const OSB_DB::Session session,
const DateTime newTs 
) [protected, virtual]

Change the assignment time of a pers. device.

Parameters:
session Database session to use.
newTs Changed assignment date and time.
Returns:
true if the assignment time was changed, else false.
Exceptions:
OsbException if newTs creates an overlap with another assignment of the device.
OsbException if the assigned device was modified.

Reimplemented from OSB_LIB::PersProductItem.

AutoPtr OSB_LIB::PersDevice::clone (  )  const

Virtual copy construction.

For details see quality manual, implementation patterns.

Reimplemented from OSB_LIB::PersProductItem.

Reimplemented in OSB_LIB::PersUimCard.

virtual bool OSB_LIB::PersDevice::deassignOld ( const OSB_DB::Session session  )  [protected, virtual]

Deassign the pers. product item in the database.

The function is called when the status of the pers node is not created.
It calls deassignOldBase() to set the deassign date of the base class.
Derived class may reimplement it if they have specific things to do.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.

Reimplemented from OSB_LIB::PersProductItem.

bool OSB_LIB::PersDevice::delPersDevice ( const OSB_DB::Session session  )  [protected]

Delete a pers. device from the database.

Parameters:
session Database session to use.
Returns:
true if the pers. device was found and deleted from the database, else false.
Exceptions:
OsbException if no device is assigned.

virtual Device* OSB_LIB::PersDevice::device (  )  [private, pure virtual]

Non-const access to the assigned device.

Returns:
A pointer to the assigned device. It is 0 if no device is assigned.

Implemented in OSB_LIB::PersUimCard.

virtual const Device* OSB_LIB::PersDevice::device (  )  const [pure virtual]

Access to the assigned device.

Returns:
A pointer to the assigned device, it is 0 if no device is assigned.

Implemented in OSB_LIB::PersUimCard.

Id<Device> OSB_LIB::PersDevice::dvcId (  )  const

The id of the assigned device.

Returns:
The object id of the assigned device. It is not set if no device is assigned.

bool OSB_LIB::PersDevice::insPersDevice ( const OSB_DB::Session session  )  [protected]

Insert a pers. device to the database.

Maintains the link between the subscribed device and the pers. item.

Parameters:
session Database session to use.
Returns:
true if the pers. device was inserted into the database, else false.
Exceptions:
OsbException if no device is assigned.

virtual Device* OSB_LIB::PersDevice::mkDevice ( const Id< Device > &  dvcId  )  [private, pure virtual]

Create an empty device.

Parameters:
dvcId Object id of the device.
Returns:
A pointer to the device, it must not be 0 and its object id is dvcId.
The returned pointer must be owned by the object on which the method is called, the ownership is NOT transferred to the caller.

Remarks:
This member is needed by readPersDevice() where the product item is being constructed from the database.
Note:
Because gcc (and possibly other compilers) support covariant return types only recently, the return type should remain Device*.

Implemented in OSB_LIB::PersUimCard.

virtual Device* OSB_LIB::PersDevice::oldDevice (  )  [private, pure virtual]

Non-const access to the previous assigned device.

Returns:
A pointer to the previous assigned device. It is 0 if no old device is assigned.

Implemented in OSB_LIB::PersUimCard.

virtual const Device* OSB_LIB::PersDevice::oldDevice (  )  const [pure virtual]

Access to the old assigned device.

Returns:
A pointer to the old assigned device, it is 0 if no old device is assigned.

Implemented in OSB_LIB::PersUimCard.

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

Assignment for derived classes only.

virtual bool OSB_LIB::PersDevice::overwrite ( const OSB_DB::Session session  )  [protected, virtual]

Overwrite a pers. device in the database.

Parameters:
session Database session to use.
Returns:
true in case of success, else false.
Exceptions:
OsbException if no old device exists.
OsbException if no new device is assigned.
See documentation of base class for more detail.

Reimplemented from OSB_LIB::PersProductItem.

bool OSB_LIB::PersDevice::readPersDevice ( const OSB_DB::Session session  )  [protected]

(Re)read a pers. device item from the database.

Parameters:
session Database session to use.
Returns:
true if the pers. device was read from the database, else false.
Exceptions:
OsbException Device type specific exceptions from Device::read().


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