home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iappl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  2.0 KB  |  83 lines

  1. /**********************************************************************
  2. *                                                                     *
  3. *  IBM(R) VisualAge(TM) for C++ for Windows(R), Version 3.5           *
  4. *                                                                     *
  5. *  PID: 5622-880                                                      *
  6. *  - Licensed Material - Program-Property of IBM                      *
  7. *  (C) Copyright IBM Corp. 1991, 1995 - All Right Reserved.           *
  8. *                                                                     *
  9. *  US Government Users Restricted Rights - Use, duplication or        *
  10. *  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.  *
  11. *                                                                     *
  12. *  VisualAge, and IBM are trademarks or registered trademarks of      *
  13. *  International Business Machines Corporation.                       *
  14. *  Windows is a registered trademark of Microsoft Corporation.        *
  15. *                                                                     *
  16. **********************************************************************/
  17.  
  18. #ifndef _IAPPL_H
  19. #define _IAPPL_H
  20.  
  21. #include <iglobals.h>
  22.  
  23. #pragma info (nocls, nocnd, nocns, nocnv, noext, nognr, novft)
  24. #pragma pack (4)
  25.  
  26. #pragma SOMAsDefault (off)
  27.  
  28. template <class Element>
  29. class IApplicator {
  30. public:
  31.  
  32.   virtual
  33.   IBoolean applyTo          (Element&) = 0;
  34.  
  35. protected:
  36.  
  37. private:
  38.  
  39.  
  40. };
  41.  
  42. template <class Element>
  43. class IConstantApplicator {
  44. public:
  45.  
  46.   virtual
  47.   IBoolean applyTo          (Element const&) = 0;
  48.  
  49. protected:
  50.  
  51. private:
  52.  
  53.  
  54. };
  55.  
  56. class IInternalApplicator {
  57. public:
  58.  
  59.   virtual
  60.   IBoolean applyTo          (void*)
  61.            { return true;
  62.            }
  63.  
  64. protected:
  65.  
  66. private:
  67.  
  68.  
  69. };
  70.  
  71. inline IBoolean
  72. __applFunc (void* element, void* applicator)
  73. {
  74.   return ((IInternalApplicator*)applicator)->applyTo (element);
  75. }
  76.  
  77. #pragma SOMAsDefault (pop)
  78.  
  79. #pragma info (restore)
  80. #pragma pack ()
  81.  
  82. #endif
  83.