NormalUser Class Reference

Even this class, as far as AdminUser, derives from User and is associated with entity customer, detailed in ER model. More...

#include <User.h>

Inheritance diagram for NormalUser:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 NormalUser ()
 Default constructor.
 NormalUser (Row &aRow)
 Class constructor by fetched record.
 ~NormalUser ()
 Default destructor.
OrderplaceOrder () throw (string)
 New order creation.
BasketgetBasket ()

Private Attributes

Basket basket

Detailed Description

Even this class, as far as AdminUser, derives from User and is associated with entity customer, detailed in ER model.

A normal user must be intended as a customer who need to browse the product catalog and, possibly, buy one or more products. Whenever a registered user wants to buy a product, he must choose how many pieces of each product should be added to the basket and ask the system to place a new order: the class Basket, as described further on, is the container of products the user chose; it appears clear that the implementation of virtual method getBasket() will return the instance of class Basket owned by the current user.


Constructor & Destructor Documentation

NormalUser::NormalUser (  ) 

Default constructor.

See also:
User, ManagedObject

References LOG_CTOR.

NormalUser::NormalUser ( Row &  aRow  ) 

Class constructor by fetched record.

Constructs an instance of NormalUser and fill it with data taken from mysqlpp::Row

Parameters:
aRow Record fetched from the database
See also:
ManagedObject, User::User, mysqlpp::Row

References LOG_CTOR.

NormalUser::~NormalUser (  ) 

Default destructor.

References LOG_DTOR.


Member Function Documentation

Basket* NormalUser::getBasket (  )  [inline, virtual]

Implements User.

References basket.

Order * NormalUser::placeOrder (  )  throw (string) [virtual]

New order creation.

Call this method when the user has a filled his basket and want to place a new order; if successful, an instance of class Order is returned and the basket is cleared.

Returns:
An instance of class Order if successful, NULL otherwise
See also:
Order, Order::create()

Implements User.

References basket, Order::create(), ManagedObject::intForKey(), and KEY_USR_UID.


Member Data Documentation

Referenced by getBasket(), and placeOrder().


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2