home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / keysrt.zip / aperson.cpv < prev    next >
Text File  |  1996-02-23  |  1KB  |  71 lines

  1.  
  2.  
  3. // Feature source code generation begins here...
  4. INotificationId APerson::NameId = "APerson::name";
  5. INotificationId APerson::AgeId = "APerson::age";
  6. INotificationId APerson::SexId = "APerson::sex";
  7.  
  8.  
  9. APerson& APerson::setName(const IString& aName)
  10. {
  11.   if (!(iName == aName))
  12.   {
  13.     iName = aName;
  14.     notifyObservers(INotificationEvent(APerson::NameId, *this));
  15.   } // endif
  16.   return *this;
  17. }
  18.  
  19. IString APerson::Age() const
  20. {
  21.   return iAge;
  22. }
  23.  
  24. APerson& APerson::setAge(const IString& aAge)
  25. {
  26.   if (!(iAge == aAge))
  27.   {
  28.     iAge = aAge;
  29.     notifyObservers(INotificationEvent(APerson::AgeId, *this));
  30.   } // endif
  31.   return *this;
  32. }
  33.  
  34. IString APerson::Sex() const
  35. {
  36.   return iSex;
  37. }
  38.  
  39. APerson& APerson::setSex(const IString& aSex)
  40. {
  41.   if (!(iSex == aSex))
  42.   {
  43.     iSex = aSex;
  44.     notifyObservers(INotificationEvent(APerson::SexId, *this));
  45.   } // endif
  46.   return *this;
  47. }
  48.  
  49. // Feature source code generation ends here.
  50.  
  51.  
  52. IString APerson::asString() const
  53. {
  54.   return IString(Name()) + "." + IString(Sex()) + "." + IString(Age());
  55. }
  56.  
  57.  
  58. // Feature source code generation begins here...
  59.  
  60. const IString& APerson::Name() const
  61. {
  62.   return iName;
  63. }
  64.  
  65. // Feature source code generation ends here.
  66.  
  67. APerson::APerson(IString name, IString age, IString sex):
  68.         iName(name),iAge(age),iSex(sex)
  69.   {}
  70.  
  71.