home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / VISBUILD / CALCULAT / CPPOV13 / ICALCOP.HPP < prev    next >
Text File  |  1995-04-14  |  3KB  |  76 lines

  1. #ifndef _ICALCOP_
  2. #define _ICALCOP_
  3. //****************************************************************************
  4. // ICalcOperator Class - C++ Header File (icalcop.hpp)                       *
  5. //                                                                           *
  6. // COPYRIGHT: Copyright (C) International Business Machines Corp., 1994,1995 *
  7. //                                                                           *
  8. // DISCLAIMER OF WARRANTIES:                                                 *
  9. //   The following [enclosed] code is sample code created by IBM             *
  10. //   Corporation.  This sample code is not part of any standard IBM product  *
  11. //   and is provided to you solely for the purpose of assisting you in the   *
  12. //   development of your applications.  The code is provided "AS IS",        *
  13. //   without warranty of any kind.  IBM shall not be liable for any damages  *
  14. //   arising out of your use of the sample code, even if they have been      *
  15. //   advised of the possibility of such damages.                             *
  16. //****************************************************************************
  17. //NOTE: WE RECOMMEND USING A FIXED-SPACE FONT TO LOOK AT THE SOURCE.
  18. //
  19. // VERSION 2
  20. //
  21. // Changes:
  22. //   9/23/94 - Put in changes to get results of math computations via a return
  23. //             value on a connection.  This also allows for connecting in some
  24. //             exception handling.
  25. //****************************************************************************
  26.  
  27. #include <istring.hpp>
  28. #include <istdntfy.hpp>
  29.  
  30. //**************************************************************************
  31. // Class:   ICalcOperator
  32. //
  33. // Purpose: Describes ICalcOperator
  34. //   This is the abstract base class for all calculator binary operations.
  35. //   This defines the pluggable interface for all binary operation 
  36. //   functions.
  37. //************************************************************************** */
  38.  
  39. class _Export ICalcOperator : public IStandardNotifier
  40. {
  41. public:
  42.            ICalcOperator          ();
  43.   virtual  ~ICalcOperator ();
  44.  
  45. //
  46. // List of Part Events
  47. //
  48.  
  49. static INotificationId resultId;
  50.  
  51. //
  52. // List of Part Actions
  53. //
  54.  
  55. virtual double
  56.   result () const;
  57.  
  58. virtual double
  59.   setResult (double iResult);
  60.  
  61. //
  62. //Implementor Method Functions
  63. //
  64.  
  65. virtual double
  66.   evaluate (double operand1, double operand2) = 0;
  67.  
  68.  
  69. protected:
  70. // List of data members
  71.   double dResult;
  72.  
  73. };
  74.  
  75. #endif
  76.