home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / lancelot / lcnrobj.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  3.7 KB  |  66 lines

  1. /******************************************************************************
  2. * .FILE:         lcnrobj.hpp                                                  *
  3. *                                                                             *
  4. * .DESCRIPTION:  Lancelot Sample Program:              Class Definition       *
  5. *                                                                             *
  6. * .CLASSES:      LCnrObject                                                   *
  7. *                                                                             *
  8. * .COPYRIGHT:                                                                 *
  9. *    Licensed Material - Program-Property of IBM                              *
  10. *    (C) Copyright IBM Corp. 1992, 1996 - All Rights Reserved                 *
  11. *                                                                             *
  12. * .DISCLAIMER:                                                                *
  13. *   The following [enclosed] code is sample code created by IBM               *
  14. *   Corporation.  This sample code is not part of any standard IBM product    *
  15. *   and is provided to you solely for the purpose of assisting you in the     *
  16. *   development of your applications.  The code is provided 'AS IS',          *
  17. *   without warranty of any kind.  IBM shall not be liable for any damages    *
  18. *   arising out of your use of the sample code, even if they have been        *
  19. *   advised of the possibility of such damages.                               *
  20. *                                                                             *
  21. * .NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE          *
  22. *                                                                             *
  23. ******************************************************************************/
  24. #ifndef _LCNROBJ_
  25. #define _LCNROBJ_
  26. #include <icnrobj.hpp>
  27. #include <istring.hpp>
  28. #include <ireslib.hpp>
  29.  
  30. /******************************************************************************
  31. * Class LCnrObject - Generic container object                                 *
  32. ******************************************************************************/
  33. class LCnrObject : public IContainerObject
  34. {
  35.    public:
  36. /*------------------------ Constructors/Destructor ----------------------------
  37. | Construct the object in three of four ways:                                 |
  38. | 1) String title, icon resourceId.                                           |
  39. | 2) ResourceId title, icon resourceId.                                       |
  40. | 3) Existing object                                                          |
  41. -----------------------------------------------------------------------------*/
  42.       LCnrObject( IString title, unsigned long icon );
  43.  
  44.       LCnrObject( IResourceId title, unsigned long icon );
  45.  
  46.       LCnrObject( const LCnrObject& cnrobj );
  47.  
  48.      ~LCnrObject();
  49.  
  50. /*------------------------------- Accessors -----------------------------------
  51. | These functions provide a means of getting and setting the accessible       |
  52. | attributes of instances of this class:                                      |
  53. |   incrementUsage      - Increments the cnr object usage count               |
  54. |   decrementUsage      - Decrements the cnr object usage count               |
  55. |   usageCount          - Returns the current usage count for the cnr object  |
  56. -----------------------------------------------------------------------------*/
  57.       inline LCnrObject
  58.          &incrementUsage() { incrementUseCount(); return *this; };
  59.       inline LCnrObject
  60.          &decrementUsage() { decrementUseCount(); return *this; };
  61.  
  62.       inline unsigned long
  63.          usageCount() { return useCount(); };
  64. };
  65. #endif
  66.