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

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //                      SAMPLE CODE
  3. //
  4. // FileName:     ACDFPsn5.hpp
  5. //
  6. // ClassName:    APerson
  7. //
  8. // Description:  Compound Document Framework Collection Streaming
  9. //               A collection of this is class used in both the keyed
  10. //               and sequence collections.
  11. ///////////////////////////////////////////////////////////////////////////////
  12. #ifndef _PERSON_
  13. #define _PERSON_
  14.  
  15. #ifdef IC_TRACE_DEVELOP
  16.     #include <itrace.hpp>
  17. #else
  18.     #define IFUNCTRACE_DEVELOP()
  19.     #define ITRACE_DEVELOP(x)
  20. #endif
  21.  
  22. #include <ibasstrm.hpp>
  23. #include <imetatyp.hpp>
  24. #include <istring.hpp>
  25.  
  26. class TPerson
  27. {
  28. public:
  29.     TypeExtensionDeclarationsMacro(TPerson) //Streaming template
  30.  
  31.                                 TPerson(const IString& name, const IString& age);
  32.                                 TPerson();
  33.  
  34.     IString                     getName() const;
  35.     IString                     getAge() const;
  36.  
  37.     virtual     IBaseStream&    operator>>=(IBaseStream& towhere) const;
  38.     virtual     IBaseStream&    operator<<=(IBaseStream& towhere);
  39.                 Boolean         operator==(TPerson& );
  40.  
  41.     // Required to support TPerson's in IKeySet's
  42.     friend const IString&       key(const TPerson& k)
  43.     { 
  44.         return k.fName; 
  45.     }
  46.  
  47.  
  48. private:
  49.     enum EVersion               { kOriginalVersion };
  50.     IString                     fName;
  51.     IString                     fAge;
  52. };
  53.  
  54. #endif
  55.