00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "stockcontainer.h"
00019 #include "stock.h"
00020 #include "stockgui.h"
00021 #include "config.h"
00022
00026 StockContainer::StockContainer(const Stock & stockParam) {
00027 stock = new Stock(stockParam);
00028 }
00029
00030
00034 StockContainer::StockContainer(const StockContainer & stockContainer) {
00035 Stock *s = stockContainer.getStock();
00036 stock = new Stock(*s);
00037 }
00038
00039
00043 StockContainer::~StockContainer() {
00044 delete stock;
00045 #ifdef DEBUG
00046 cout << "deleting stockcontainer" << endl;
00047 #endif
00048 }
00049
00053 Stock * const StockContainer::getStock() const {
00054 return stock;
00055 }
00056
00057
00063 int operator!=(const StockContainer &x, const StockContainer &y) {
00064 #ifdef DEBUG
00065 cout << "StockContainer::Operator != is called" << endl;
00066 #endif
00067 return ( *((StockContainer)x).getStock() != *((StockContainer)y).getStock());
00068 }
00069
00070
00076 bool operator<(const StockContainer &x, const StockContainer &y) {
00077 #ifdef DEBUG
00078 cout << "StockContainer::Operator < is called" << endl;
00079 #endif
00080
00081 return ( *((StockContainer)x).getStock() < *((StockContainer)y).getStock() );
00082 }