//
// $Id: Quoter.idl 74311 2006-08-29 12:52:23Z johnnyw $
//

module Quoter
{
  exception Invalid_Stock_Symbol {};
  // Used to report an invalid stock name

  // Forward declare the Stock interface
  interface Stock;

  interface Stock_Factory
  {
    // = TITLE
    //   A factory class for the stock quoter interfaces
    //
    // = DESCRIPTION
    //   Return the Quoter interfaces based on their names
    //
    Stock get_stock (in string stock_symbol)
      raises (Invalid_Stock_Symbol);
  };

  interface Stock
  {
    // = TITLE
    //   A simple interface to query the name and price of stock
    //
    // = DESCRIPTION
    //   Return the price and name of a single stock
    //

    typedef sequence<double> StockHistory ;

    readonly attribute string symbol;
    // Get the stock symbol.

    readonly attribute string full_name;
    // Get the name.

    double price ();
    // Get the price

    StockHistory history() ;

  };
};
