home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / UI / ConcreteFormObject.h < prev    next >
C/C++ Source or Header  |  2000-06-03  |  974b  |  46 lines

  1. //
  2. //  $Id: ConcreteFormObject.h,v 1.1.1.1 2000/06/02 22:22:59 sergey Exp $
  3. //
  4.  
  5. #ifndef _ConcreteFormObject_h_
  6. #define _ConcreteFormObject_h_
  7.  
  8. #include "FormObject.h"
  9. #include "Form.h"
  10.  
  11. namespace UI
  12. {
  13.     //
  14.     // Concrete FormObject template class
  15.     //
  16.     template <typename P, FormObjectKind K>
  17.     class ConcreteFormObject: public FormObject
  18.     {
  19.     public:
  20.         ConcreteFormObject(Form& parent, Word objectID):
  21.             FormObject(parent, objectID),
  22.             _objectPtr(0)
  23.         {}
  24.  
  25.     // attributes
  26.  
  27.         P objectPtr() const;
  28.  
  29.     // data members
  30.     private:
  31.         mutable P _objectPtr;
  32.     };
  33.  
  34.  
  35.     template <typename P, FormObjectKind K>
  36.     P ConcreteFormObject<P,K>::objectPtr() const
  37.     {
  38.         if (_objectPtr == 0)
  39.             _objectPtr = reinterpret_cast<P>(parent().getGenericObjectPtr(K, objectID()));
  40.         return _objectPtr;
  41.     }
  42. }
  43. // namespace UI
  44.  
  45. #endif // _ConcreteFormObject_h_
  46.