home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / LANCELOT / LCNROBJ.HPP < prev    next >
C/C++ Source or Header  |  1995-04-01  |  3KB  |  60 lines

  1. /******************************************************************************
  2. * FILE NAME: lcnrobj.hpp                                                      *
  3. *                                                                             *
  4. * DESCRIPTION: Generic container object                                       *
  5. *                                                                             *
  6. * Classes:                                                                    *
  7. *   LCnrObject                                                                *
  8. *                                                                             *
  9. * COPYRIGHT:                                                                  *
  10. *   Licensed Materials - Property of IBM                                      *
  11. *   (C) Copyright IBM Corporation 1992, 1995                                  *
  12. *   All Rights Reserved                                                       *
  13. *   US Government Users Restricted Rights - Use, duplication, or disclosure   *
  14. *   restricted by GSA ADP Schedule Contract with IBM Corp.                    *
  15. *                                                                             *
  16. ******************************************************************************/
  17.  
  18. #ifndef _LCNROBJ_
  19. #define _LCNROBJ_
  20. #include <icnrobj.hpp>
  21. #include <istring.hpp>
  22. #include <ireslib.hpp>
  23.  
  24. /******************************************************************************
  25. * Class LCnrObject - Generic container object                                 *
  26. ******************************************************************************/
  27. class LCnrObject : public IContainerObject
  28. {
  29.    public:
  30. /*------------------------ Constructors/Destructor ----------------------------
  31. | Construct the object in three of four ways:                                 |
  32. | 1) String title, icon resourceId.                                           |
  33. | 2) ResourceId title, icon resourceId.                                       |
  34. | 3) Existing object                                                          |
  35. -----------------------------------------------------------------------------*/
  36.       LCnrObject( IString title, unsigned long icon );
  37.  
  38.       LCnrObject( IResourceId title, unsigned long icon );
  39.  
  40.       LCnrObject( const LCnrObject& cnrobj );
  41.  
  42.      ~LCnrObject();
  43.  
  44. /*------------------------------- Accessors -----------------------------------
  45. | These functions provide a means of getting and setting the accessible       |
  46. | attributes of instances of this class:                                      |
  47. |   incrementUsage      - Increments the cnr object usage count               |
  48. |   decrementUsage      - Decrements the cnr object usage count               |
  49. |   usageCount          - Returns the current usage count for the cnr object  |
  50. -----------------------------------------------------------------------------*/
  51.       inline LCnrObject
  52.          &incrementUsage() { incrementUseCount(); return *this; };
  53.       inline LCnrObject
  54.          &decrementUsage() { decrementUseCount(); return *this; };
  55.  
  56.       inline unsigned long
  57.          usageCount() { return useCount(); };
  58. };
  59. #endif
  60.