29#ifndef STOCKS_H_INCLUDED
30#define STOCKS_H_INCLUDED
51# define US_LOCALE "en_US"
52# define GERMAN_LOCALE "de_DE"
53# define FRENCH_LOCALE "fr_FR"
54# define JAPANESE_LOCALE "ja_JP"
56# define US_LOCALE "en_US.iso88591"
57# define GERMAN_LOCALE "de_DE.iso88591"
58# define FRENCH_LOCALE "fr_FR.iso88591"
59# define JAPANESE_LOCALE "ja_JP.eucJP"
60#elif defined (__linux__)
61# define US_LOCALE "en_US"
62# define GERMAN_LOCALE "de_DE"
63# define FRENCH_LOCALE "fr_FR"
64# define JAPANESE_LOCALE "ja_JP"
65#elif defined (__osf__)
66# define US_LOCALE "en_US.ISO8859-1"
67# define GERMAN_LOCALE "de_DE.ISO8859-1"
68# define FRENCH_LOCALE "fr_FR.ISO8859-1"
69# define JAPANESE_LOCALE "ja_JP"
71# define US_LOCALE "En"
72# define GERMAN_LOCALE "De"
73# define FRENCH_LOCALE "Fr_FR.850"
74# define JAPANESE_LOCALE "Ja_JP.932"
76# define US_LOCALE "us"
77# define GERMAN_LOCALE "german_germany.1252"
78# define FRENCH_LOCALE "french_france.1252"
79# define JAPANESE_LOCALE "japanese_japan.1252"
81# define US_LOCALE "en_US"
82# define GERMAN_LOCALE "de_DE"
83# define FRENCH_LOCALE "fr_FR"
84# define JAPANESE_LOCALE "ja_JP"
89 const int stock_change[10] = { 0, 1, -1, 2, -1, 3, -3, 4, -1, -1 };
90 const int indexSize = 10;
127 std::string companyNews;
129 std::size_t marketOutlook() {
137 typedef std::basic_ostream<char,std::char_traits<char> >
outStream;
138 typedef std::ostreambuf_iterator<char, std::char_traits<char> >
iter_type;
139 typedef std::deque<Company*,std::allocator<Company*> >
database;
146 static std::locale::id
id;
147 virtual bool put (std::ostream&
os)
const;
148 virtual void add (
const std::string&
name,
double initPrice);
149 virtual void localTime (std::ostream&)
const;
181 virtual bool put (std::ostream&
os)
const {
183 os <<
"######## TOKYO STOCK EXCHANGE #########\n";
204 virtual bool put (std::ostream&
os)
const {
206 os <<
"######## FRANKFURTER WERTPAPIERB\366RSE #########\n";
228 virtual bool put (std::ostream&
os)
const {
230 os <<
"######## NEW YORK STOCK EXCHANGE ########\n";
251 virtual bool put (std::ostream&
os)
const {
253 os <<
"######## BOURSE DE PARIS #########\n";
int changeIndex(bool increment=false)
Company(const std::string &s, double p)
virtual bool put(std::ostream &os) const
virtual void localTime(std::ostream &os) const
FrankfurtStockXchange(std::size_t refs=0)
virtual void localTime(std::ostream &os) const
NewYorkStockXchange(std::size_t refs=0)
virtual bool put(std::ostream &os) const
virtual void localTime(std::ostream &os) const
virtual bool put(std::ostream &os) const
ParisStockXchange(std::size_t refs=0)
static std::locale::id id
std::deque< Company *, std::allocator< Company * > > database
std::basic_ostream< char, std::char_traits< char > > outStream
virtual bool put(std::ostream &os) const
virtual void localTime(std::ostream &) const
std::ostreambuf_iterator< char, std::char_traits< char > > iter_type
StockXchange(std::size_t refs=0)
virtual void add(const std::string &name, double initPrice)
friend StockXchange::outStream & operator<<(StockXchange::outStream &, const StockXchange &)
virtual bool put(std::ostream &os) const
virtual void localTime(std::ostream &os) const
TokyoStockXchange(std::size_t refs=0)