#include "SellOrder.h" #include "Investor.h" SellOrder::SellOrder( Investor* i , Stock* stock, double price, long amount ) : Order( i, stock, price, amount ) { if ( i != 0 ) i->reserve( stock, amount ); } SellOrder::~SellOrder() { investor_->release( stock(), amount() ); } bool SellOrder::execute( double price, long amount ) { bool ret = true; if ( investor_ != 0 ) { investor_->sell( stock(), price, amount ); investor_->release( stock(), amount ); } dump( price, amount ); return ret; }