Main Page   Class Hierarchy   Data Structures   File List   Data Fields  

stockcontainer.cpp

00001 /***************************************************************************
00002                           stockcontainer.cpp  -  description
00003                              -------------------
00004     begin                : Fri Jan 14 2003
00005     copyright            : (C) 2002 by Michael Otto
00006     email                : Michael.Otto@saskathex.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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 }

Generated on Tue May 27 21:24:02 2003 for gstockcalc by doxygen1.3-rc3