Main Page   Class Hierarchy   Data Structures   File List   Data Fields  

Stock Class Reference

#include <stock.h>

Inheritance diagram for Stock:

Inheritance graph
[legend]
Collaboration diagram for Stock:

Collaboration graph
[legend]

Public Member Functions

 Stock ()
 Stock (const string &name, const string &wkn, const string &buyingDate, const int &Amount, const float &buyRate, const float &purchaseCost, const float &currentMarketPrice)
 Stock (const string &name, const string &wkn, const string &buyingDate, const int &Amount, const float &buyRate, const float &purchaseCost, const float &currentMarketPrice, const vector< float > &values)
 Stock (const Stock &stock)
 ~Stock ()
string getName () const
string getWkn () const
string getBuyingDate () const
int getAmount () const
float getBuyingRate () const
float getPurchaseCost () const
float getCurrentMarketPrice () const
float getCurrentMarketPriceDayBefore () const
vector< float > getValuesVector () const
void setName (const string &name)
void setWkn (const string &wkn)
void setBuyingDate (const string &buyingDate)
void setAmount (const int &Amount)
void setBuyingRate (const float &buyingRate)
void setPurchaseCost (const float &purchaseCost)
void setCurrentMarketPrice (const float &CurrentMarketPrice)
void setCurrentMarketPriceDayBefore (const float &CurrentMarketPriceDayBefore)

Friends

int operator!= (const Stock &x, const Stock &y)
int operator== (const Stock &x, const Stock &y)
bool operator< (const Stock &x, const Stock &y)

Detailed Description

A Stock with all the information.
Author:
Michael Otto

Definition at line 32 of file stock.h.


Constructor & Destructor Documentation

Stock::Stock  
 

constructor.

Definition at line 24 of file stock.cpp.

Stock::Stock const string &    name,
const string &    wkn,
const string &    buyingDate,
const int &    amount,
const float &    buyingRate,
const float &    purchaseCost,
const float &    currentMarketPrice
 

constructor.

Parameters:
name name of stock
wkn stock wkn or id
buyingDate buying date of stock
amount amount of stocks
buyingRate stock buying rate
purchaseCost stock purchase cost
currentMarketPrice current price of stock

Definition at line 36 of file stock.cpp.

Stock::Stock const string &    name,
const string &    wkn,
const string &    buyingDate,
const int &    amount,
const float &    buyingRate,
const float &    purchaseCost,
const float &    currentMarketPrice,
const vector< float > &    values
 

constructor.

Parameters:
name name of stock
wkn stock wkn or id
buyingDate buying date of stock
amount amount of stocks
buyingRate stock buying rate
purchaseCost stock purchase cost
currentMarketPrice current price of stock
values values vector of stock

Definition at line 62 of file stock.cpp.

Stock::Stock const Stock &    stock
 

copy constructor.

Definition at line 87 of file stock.cpp.

References getAmount(), getBuyingDate(), getBuyingRate(), getCurrentMarketPrice(), getCurrentMarketPriceDayBefore(), getName(), getPurchaseCost(), getValuesVector(), and getWkn().

Stock::~Stock  
 

destructor

Definition at line 108 of file stock.cpp.

References Subject::detachAllObservers().


Member Function Documentation

int Stock::getAmount   const
 

Returns the number of stocks.

Returns:
number of stocks

Definition at line 140 of file stock.cpp.

Referenced by Stock(), SummaryDialog::SummaryDialog(), and StockGui::update().

string Stock::getBuyingDate   const
 

Returns the stock buying date.

Returns:
buying date of stock

Definition at line 133 of file stock.cpp.

Referenced by Stock(), and StockGui::update().

float Stock::getBuyingRate   const
 

Returns the stock buying rate.

Returns:
byuing rate of stock

Definition at line 147 of file stock.cpp.

Referenced by Stock(), SummaryDialog::SummaryDialog(), and StockGui::update().

float Stock::getCurrentMarketPrice   const
 

Returns the stock current market price.

Returns:
current market price of stock

Definition at line 161 of file stock.cpp.

Referenced by Stock(), SummaryDialog::SummaryDialog(), and StockGui::update().

float Stock::getCurrentMarketPriceDayBefore   const
 

Returns the stock yesterdays current market price.

Returns:
yesterdays current market price of stock

Definition at line 169 of file stock.cpp.

Referenced by Stock().

string Stock::getName   const
 

Returns the stock name.

Returns:
name of stock

Definition at line 119 of file stock.cpp.

Referenced by StockMarket::removeStock(), Stock(), and StockGui::update().

float Stock::getPurchaseCost   const
 

Returns the stock purchase cost.

Returns:
purchase cost of stock

Definition at line 154 of file stock.cpp.

Referenced by Stock(), SummaryDialog::SummaryDialog(), and StockGui::update().

vector< float > Stock::getValuesVector   const
 

Returns the stock values vector.

Returns:
values vector of stock

Definition at line 176 of file stock.cpp.

Referenced by Stock().

string Stock::getWkn   const
 

Returns the stock wkn or id.

Returns:
wkn or id of stock

Definition at line 126 of file stock.cpp.

Referenced by Stock(), and StockGui::update().

void Stock::setAmount const int &    amount
 

Sets the number stock s.

Parameters:
amount number of stocks

Definition at line 207 of file stock.cpp.

References Subject::notify().

void Stock::setBuyingDate const string &    buyingDate
 

Sets the stock buying date.

Parameters:
buyingDate buying date of stock

Definition at line 199 of file stock.cpp.

References Subject::notify().

void Stock::setBuyingRate const float &    buyingRate
 

Sets the stock buying rate.

Parameters:
buyingRate buying rate of stock

Definition at line 215 of file stock.cpp.

References Subject::notify().

void Stock::setCurrentMarketPrice const float &    currentMarketPrice
 

Sets the stock current market price.

Parameters:
currentMarketPrice current market price of stock

Definition at line 231 of file stock.cpp.

References Subject::notify().

void Stock::setCurrentMarketPriceDayBefore const float &    currentMarketPriceDayBefore
 

Sets the stock yesterdays current market price.

Parameters:
currentMarketPriceDayBefore yesterdays current market price of stock

Definition at line 239 of file stock.cpp.

References Subject::notify().

void Stock::setName const string &    name
 

Sets the stock name.

Parameters:
name name of stock

Definition at line 183 of file stock.cpp.

References Subject::notify().

void Stock::setPurchaseCost const float &    purchaseCost
 

Sets the stock purchase cost.

Parameters:
purchaseCost purchase cost of stock

Definition at line 223 of file stock.cpp.

References Subject::notify().

void Stock::setWkn const string &    wkn
 

Sets the stock wkn or id.

Parameters:
wkn wkn or id of stock

Definition at line 191 of file stock.cpp.

References Subject::notify().


Friends And Related Function Documentation

int operator!= const Stock &    x,
const Stock &    y
[friend]
 

!= operator (x != y)

Parameters:
x Stock x
y Stock y
Returns:
!= value

Definition at line 249 of file stock.cpp.

bool operator< const Stock &    x,
const Stock &    y
[friend]
 

< operator (x < y)

Parameters:
x Stock x
y Stock y
Returns:
< value

Definition at line 286 of file stock.cpp.

int operator== const Stock &    x,
const Stock &    y
[friend]
 

== operator (x == y)

Parameters:
x Stock x
y Stock y
Returns:
== value

Definition at line 267 of file stock.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 27 21:24:04 2003 for gstockcalc by doxygen1.3-rc3