home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ibmodf.zip / CUSTOMER.ZIP / BALANCE.HPP < prev    next >
Text File  |  1995-06-19  |  4KB  |  95 lines

  1. #ifndef _BALANCE_
  2.   #define _BALANCE_
  3. /*******************************************************************************
  4. * FILE NAME: iadd.hpp                                                          *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *    Balance - Builder part written by hypothetical customer                   *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   Licensed Materials - Property of IBM                                       *
  12. *   (C) Copyright IBM Corporation 1994, 1995                                   *
  13. *   All Rights Reserved                                                        *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. * DISCLAIMER OF WARRANTIES:                                                    *
  18. *   The following [enclosed] code is sample code created by IBM                *
  19. *   Corporation.  This sample code is not part of any standard IBM product     *
  20. *   and is provided to you solely for the purpose of assisting you in the      *
  21. *   development of your applications.  The code is provided "AS IS",           *
  22. *   without warranty of any kind.  IBM shall not be liable for any damages     *
  23. *   arising out of your use of the sample code, even if they have been         *
  24. *   advised of the possibility of such damages.                                *
  25. *******************************************************************************/
  26.  
  27. #include <ipart.hpp>
  28.  
  29. #if 0
  30. /*-------------------------- Pragma Library Support --------------------------*/
  31. #ifndef __NO_DEFAULT_LIBS__
  32.   #ifdef IC_PM
  33.     #ifdef __IMPORTLIB__
  34.        #pragma library("CPPOV03I.LIB")
  35.     #else
  36.        #pragma library("CPPOV03O.LIB")
  37.     #endif
  38.   #endif
  39.   #ifdef IC_WIN
  40.     #ifdef __IMPORTLIB__
  41.        #pragma library("CPPWV03I.LIB")
  42.     #else
  43.        #pragma library("CPPWV03O.LIB")
  44.     #endif
  45.   #endif
  46. #endif
  47. #endif  /* #if 0 */
  48.  
  49. /*----------------------------------------------------------------------------*/
  50. /* Align classes on four byte boundary.                                       */
  51. /*----------------------------------------------------------------------------*/
  52. #pragma pack(4)
  53.  
  54. class Balance : public IPart {
  55. /*******************************************************************************
  56. * This class is an attempt to see how a user would make a one-value addition   *
  57. * to the canned data content objects available. Is this too much "work"?       *
  58. *******************************************************************************/
  59. public:
  60.    typedef IBase Inherited;
  61.  
  62.    Balance(int aValue) : fValue(aValue)
  63.     {;}
  64.    virtual  ~Balance() 
  65.     {;}
  66.    int value() {return fValue;}
  67.    Balance &setValue(int aValue) {fValue=aValue;}
  68.    IString asString() {return IString(fValue);}
  69.  
  70. //??? In stream-oriented persistance support, use TStream??? ostream? new class?
  71. //   IStream
  72. //     &operator <<= (IStream  &aStream) { return aStream + fValue;}
  73.  
  74. /*----------------------- Notification Event Descriptions ----------------------
  75. | List of attribute and event notification identifiers:                        |
  76. |                                                                              |
  77. |   balanceId         - Notification ID provided to observers when the         |
  78. |                       balance value changes.                                 |
  79. ------------------------------------------------------------------------------*/
  80. static INotificationId const
  81.   balanceId;
  82.  
  83. private:
  84.    int fValue;
  85. }; // Balance
  86.  
  87.  
  88.  
  89. /*----------------------------------------------------------------------------*/
  90. /* Resume compiler default packing.                                           */
  91. /*----------------------------------------------------------------------------*/
  92. #pragma pack()
  93.  
  94. #endif /* BALANCE */
  95.