home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / treecnr.zip / person.cpv < prev    next >
Text File  |  1996-03-13  |  2KB  |  72 lines

  1.  
  2.  
  3. // Feature source code generation begins here...
  4. INotificationId Person::nameId = "Person::name";
  5. INotificationId Person::parentNameId = "Person::parentName";
  6. INotificationId Person::phoneNumberId = "Person::phoneNumber";
  7.  
  8. IString Person::name() const
  9. {
  10.   return iName;
  11. }
  12.  
  13. Person& Person::setName(const IString& aName)
  14. {
  15.   if (!(iName == aName))
  16.   {
  17.     iName = aName;
  18.     notifyObservers(INotificationEvent(Person::nameId, *this));
  19.   } // endif
  20.   return *this;
  21. }
  22.  
  23. IString Person::parentName() const
  24. {
  25.   return iParentName;
  26. }
  27.  
  28. Person& Person::setParentName(const IString& aParentName)
  29. {
  30.   if (!(iParentName == aParentName))
  31.   {
  32.     iParentName = aParentName;
  33.     notifyObservers(INotificationEvent(Person::parentNameId, *this));
  34.   } // endif
  35.   return *this;
  36. }
  37.  
  38. IString Person::phoneNumber() const
  39. {
  40.   return iPhoneNumber;
  41. }
  42.  
  43. Person& Person::setPhoneNumber(const IString& aPhoneNumber)
  44. {
  45.   if (!(iPhoneNumber == aPhoneNumber))
  46.   {
  47.     iPhoneNumber = aPhoneNumber;
  48.     notifyObservers(INotificationEvent(Person::phoneNumberId, *this));
  49.   } // endif
  50.   return *this;
  51. }
  52.  
  53. Person& Person::initialize(const IString aName,
  54.                            const IString aParentName,
  55.                            const IString aPhoneNumber)
  56. {
  57.   iName = aName;
  58.   iParentName = aParentName;
  59.   iPhoneNumber = aPhoneNumber;
  60. }
  61.  
  62. IString Person::asString() const
  63. {
  64.    return name();
  65. }
  66.  
  67. Boolean Person::operator== (const Person& aPerson) const
  68. {
  69.   return (aPerson.name() == name());
  70. }
  71. // Feature source code generation ends here.
  72.