home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / VISBUILD / OASEARCH / SKILL.CPV < prev    next >
Text File  |  1995-05-15  |  3KB  |  110 lines

  1. //****************************************************************************
  2. // OASkill Class - C++ Code File (skill.cpv)                                 *
  3. //                                                                           *
  4. // COPYRIGHT: Copyright (C) International Business Machines Corp., 1994,1995 *
  5. //                                                                           *
  6. // DISCLAIMER OF WARRANTIES:                                                 *
  7. //   The following [enclosed] code is sample code created by IBM             *
  8. //   Corporation.  This sample code is not part of any standard IBM product  *
  9. //   and is provided to you solely for the purpose of assisting you in the   *
  10. //   development of your applications.  The code is provided "AS IS",        *
  11. //   without warranty of any kind.  IBM shall not be liable for any damages  *
  12. //   arising out of your use of the sample code, even if they have been      *
  13. //   advised of the possibility of such damages.                             *
  14. //****************************************************************************
  15. //NOTE: WE RECOMMEND USING A FIXED-SPACE FONT TO LOOK AT THE SOURCE.
  16. //
  17. // Default Part Code Generation begins here...
  18. INotificationId OASkill::skillNameId = "OASkill::skillName";
  19. INotificationId OASkill::contractorIDId = "OASkill::contractorID";
  20. INotificationId OASkill::yearsExpId = "OASkill::yearsExp";
  21. INotificationId OASkill::keyId = "OASkill::key";
  22.  
  23. IString OASkill::skillName() const
  24. {
  25.   return iSkillName;
  26. }
  27.  
  28. OASkill & OASkill::setSkillName(const IString & aSkillName)
  29. {
  30.   if (iSkillName != aSkillName)
  31.   {
  32.     iSkillName = aSkillName;
  33.     notifyObservers(INotificationEvent(OASkill::skillNameId, *this));
  34.   } // endif
  35.   return *this;
  36. }
  37.  
  38. IString OASkill::contractorID() const
  39. {
  40.   return iContractorID;
  41. }
  42.  
  43. OASkill & OASkill::setContractorID(const IString & aContractorID)
  44. {
  45.   if (iContractorID != aContractorID)
  46.   {
  47.     iContractorID = aContractorID;
  48.     setKey("");
  49.     notifyObservers(INotificationEvent(OASkill::contractorIDId, *this));
  50.   } // endif
  51.   return *this;
  52. }
  53.  
  54. IString OASkill::yearsExp() const
  55. {
  56.   return iYearsExp;
  57. }
  58.  
  59. OASkill & OASkill::setYearsExp(const long aValue)
  60. {
  61.   IString tempYears = IString(aValue);
  62.  
  63.   if (iYearsExp != tempYears)
  64.     iYearsExp = tempYears;
  65.  
  66. // Signal event even when value of yearsExp attribute has not changed
  67.  
  68.   notifyObservers(INotificationEvent(OASkill::yearsExpId, *this));
  69.  
  70.   return *this;
  71. }
  72.  
  73. OASkill & OASkill::setYearsExp(const IString & aYearsExp)
  74. {
  75.   if (iYearsExp != aYearsExp)
  76.   {
  77.     iYearsExp = aYearsExp;
  78.     notifyObservers(INotificationEvent(OASkill::yearsExpId, *this));
  79.   } // endif
  80.   return *this;
  81. }
  82.  
  83. IString OASkill::key() const
  84. {
  85.   return iKey;
  86. }
  87.  
  88. OASkill & OASkill::setKey(const IString & aKey)
  89. {
  90.   if (iKey != aKey)
  91.     {
  92.        iKey = aKey;
  93.        notifyObservers(INotificationEvent(OASkill::keyId, *this));
  94.      }
  95.   return *this;
  96. }
  97.  
  98. // Copy constructor
  99. // Necessary for skillBase support
  100.  
  101. OASkill::OASkill(const OASkill & aSkill)
  102.   : IStandardNotifier(aSkill),
  103.   iSkillName(aSkill.skillName()),
  104.   iContractorID(aSkill.contractorID()),
  105.   iYearsExp(aSkill.yearsExp()),
  106.   iKey(aSkill.key())
  107.   {
  108.     enableNotification();
  109.   }
  110.