OSB_LIB::PersProductItems Class Reference

Collaboration diagram for OSB_LIB::PersProductItems:

Collaboration graph
[legend]
List of all members.

Detailed Description

Container for personalized product items.

The class stores the personalized product items of a pers. product node for a given period of time. The goals of the class are:

Remarks:
In order to read all personalized items of a pers. product node the period should be set to DateTime::min() rsp. DateTime::max().

Definition at line 80 of file persitems.h.

Public Types

STL container type definitions

Public Member Functions

Read access to data members
Pure wrappers to the STL container
Remarks:
Do not add an STL operation to this group if the function does more than just wrapping!
All functions return the STL operation on items_.

STL container operations
The functions do the corresponding operations on the STL container. In contrast to the pure wrappers, they provide additional functionality, e.g., call the destructor of a pers. product item.

Private Attributes

Friends


Member Typedef Documentation

typedef List::const_iterator OSB_LIB::PersProductItems::ConstIterator

STL const_iterator.

Definition at line 95 of file persitems.h.

typedef List::iterator OSB_LIB::PersProductItems::Iterator

STL iterator.

Definition at line 93 of file persitems.h.

typedef std::list<PersProductItem*> OSB_LIB::PersProductItems::List

STL container type used to store the object pointers.

Definition at line 91 of file persitems.h.

typedef List::size_type OSB_LIB::PersProductItems::SizeType

STL container size_type.

Definition at line 97 of file persitems.h.


Constructor & Destructor Documentation

OSB_LIB::PersProductItems::PersProductItems (  )  [inline]

Default constructor.

The default constructor set the flag itemsRead_ to false.

Definition at line 105 of file persitems.h.

OSB_LIB::PersProductItems::PersProductItems ( const PersProductItems rhs  ) 

Copy constructor: make a deep copy of the items.

OSB_LIB::PersProductItems::~PersProductItems (  ) 

Destructor: delete all pers. items in the list.


Member Function Documentation

ConstIterator OSB_LIB::PersProductItems::begin (  )  const [inline]

Const iterator to the beginning of the list.

Definition at line 142 of file persitems.h.

References items_.

Iterator OSB_LIB::PersProductItems::begin (  )  [inline]

Iterator to the beginning of the list.

Definition at line 138 of file persitems.h.

References items_.

void OSB_LIB::PersProductItems::clear (  ) 

Clear the item list.

ConstIterator OSB_LIB::PersProductItems::end (  )  const [inline]

Const iterator to the end of the list.

Definition at line 144 of file persitems.h.

References items_.

Iterator OSB_LIB::PersProductItems::end (  )  [inline]

Iterator to the end of the list.

Definition at line 140 of file persitems.h.

References items_.

bool OSB_LIB::PersProductItems::erase ( const Id< PersProductItem > &  id  ) 

Remove a pers. item from the list.

Parameters:
id Id of the pers. item to remove.
Returns:
false if no matching pers. item was found in items_, else true.
The function erases all pers. items with object id = id from items_.

const PersProductItem* OSB_LIB::PersProductItems::find ( const Id< PersProductItem > &  id  )  const

Find a pers. item by its object id.

Parameters:
id Id of the pers. item to find.
Returns:
A pointer to the matching pers. item, 0 if the pers. item is not found in items_.

const PersProductItem& OSB_LIB::PersProductItems::front (  )  const [inline]

The first product item in the list.

Definition at line 150 of file persitems.h.

References items_.

PersProductItem& OSB_LIB::PersProductItems::front (  )  [inline]

The first product item in the list.

Definition at line 148 of file persitems.h.

References items_.

const List& OSB_LIB::PersProductItems::items (  )  const [inline]

List of personalized items.

Definition at line 127 of file persitems.h.

References items_.

bool OSB_LIB::PersProductItems::itemsRead (  )  const [inline]

Flag if the pers. items have been read from the database.

The flag is set to true after the pers. product items are successfully read from the database.

Definition at line 125 of file persitems.h.

References itemsRead_.

PersProductItems& OSB_LIB::PersProductItems::operator= ( const PersProductItems rhs  ) 

Exception save assignment operator.

void OSB_LIB::PersProductItems::pushBack ( const PersProductItem item  ) 

Add an item to the list.

Adds a personalized item to the list. The function uses item.clone() to create a copy of the item and calls pushBack() with the returned auto pointer. The implementation is:

          pushBack(item.clone());

Parameters:
item Pers. product item to add.

void OSB_LIB::PersProductItems::pushBack ( std::auto_ptr< PersProductItem pItem  ) 

Add an item to the list.

Adds a personalized item to the list. The function takes the ownership of the auto pointer's content and calls pushBack() of the STL container. The implementation is:

          items_.push_back(pItem.release());

Parameters:
pItem Auto pointer that owns the item to add.

bool OSB_LIB::PersProductItems::replace ( std::auto_ptr< PersProductItem pItem  ) 

Replace a pers. item by its object id.

Parameters:
pItem Pers. item to replace.
Returns:
true if a pers. item with the object id of pItem exists in items_, else false.
The function replaces pItem in items_ if -and only if- it contains a pers. item with the same object id.

SizeType OSB_LIB::PersProductItems::size (  )  const [inline]

The size of the list.

Definition at line 146 of file persitems.h.

References items_.

void OSB_LIB::PersProductItems::swap ( PersProductItems rhs  ) 

Swap the content of two lists.


Friends And Related Function Documentation

friend class OSB_DB::PersProductGw [friend]

After the personalized product items have been successfully read from the database, the gateway class sets `itemsRead_' to true.

Definition at line 86 of file persitems.h.


Member Data Documentation

List OSB_LIB::PersProductItems::items_ [private]

Container with personalized product items.

Definition at line 229 of file persitems.h.

Referenced by begin(), end(), front(), items(), and size().

bool OSB_LIB::PersProductItems::itemsRead_ [private]

Pers. items read from the database?

Definition at line 227 of file persitems.h.

Referenced by itemsRead().


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