00001 /* 00002 * Copyright (c) 2010 Ferruccio Vitale <unixo@devzero.it> 00003 * All rights reserved. 00004 * 00005 * $Id: Basket.h 72 2010-08-03 16:43:52Z unixo $ 00006 */ 00007 00008 #ifndef __BASKET_H__ 00009 #define __BASKET_H__ 00010 00011 #include "common.h" 00012 00013 class Product; 00014 class ProductProxy; 00015 00020 class Basket : public std::map<int, int> 00021 { 00022 private: 00023 float _tot; 00024 00025 public: 00026 Basket(); 00027 void addProduct(Product *p, int aQty = 1); 00028 void addProduct(ProductProxy *p, int aQty = 1); 00029 float total() const; 00030 void empty(); 00031 void removeProduct(Product *p, int aQty = 1); 00032 00033 friend std::ostream & operator<<(std::ostream &, Basket &); 00034 }; 00035 00036 #endif /* __BASKET_H__ */