#ifndef ORDER_H #define ORDER_H class Stock; class Investor; class Order { public: Order( Investor*, Stock*, double price, long amount, unsigned int validity = defaultMaxValidity ); virtual ~Order(); virtual bool execute( double price, long amount ) = 0; Stock* stock() const { return stock_; } double price() const { return price_; } long amount() const { return amount_; } void notify(); bool expired() const; protected: Investor* investor_; void dump( double price, long amount ); double cost() const; private: Stock* stock_; double price_; long amount_; unsigned int validity_; static unsigned int defaultMaxValidity; }; #endif