home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / ivbvcls.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.5 KB  |  95 lines

  1. /*******************************************************************************
  2. * FILE NAME: ivbvcls.c                                                         *
  3. *                                                                              *
  4. * DESCRIPTION:                                                                 *
  5. *   Class implementation of the class(es):                                     *
  6. *    IVBVariableClass - Variable template class for classes.                   *
  7. *                                                                              *
  8. * COPYRIGHT:                                                                   *
  9. *   IBM(R) VisualAge(TM) for C++                                               *
  10. *   (C) Copyright International Business Machines Corporation 1991, 1996       *
  11. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  12. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  13. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  14. *******************************************************************************/
  15.  
  16. #ifndef _IVBVCLS_
  17.   #include <ivbvcls.h>
  18. #endif
  19.  
  20. #ifndef _INOTIFEV_
  21.   #include <inotifev.hpp>
  22. #endif
  23.  
  24. #include <ivbdefs.h>
  25.  
  26. /*------------------------------------------------------------------------------
  27. | IVBVariableClass <Element>::IVBVariableClass                                 |
  28. |                                                                              |
  29. | Standard constructor.                                                        |
  30. ------------------------------------------------------------------------------*/
  31. template < class Element >
  32. IVBVariableClass <Element>::IVBVariableClass ()
  33.   : IVBVariableClassBase ()
  34. {
  35. }
  36.  
  37. /*------------------------------------------------------------------------------
  38. | IVBVariableClass <Element>::~IVBVariableClass                                |
  39. |                                                                              |
  40. | Standard destructor.                                                         |
  41. ------------------------------------------------------------------------------*/
  42. template < class Element >
  43. IVBVariableClass <Element>::~IVBVariableClass ()
  44. {
  45. }
  46.  
  47. /*------------------------------------------------------------------------------
  48. | IVBVariableClass <Element>::target                                             |
  49. |                                                                              |
  50. | Returns the target attribute.                                                |
  51. ------------------------------------------------------------------------------*/
  52. template < class Element >
  53. Element& IVBVariableClass <Element>::target ()
  54. {
  55.   return iTarget;
  56. }
  57.  
  58. /*------------------------------------------------------------------------------
  59. | IVBVariableClass <Element>::targetPtr                                        |
  60. |                                                                              |
  61. | Returns the target attribute.                                                |
  62. ------------------------------------------------------------------------------*/
  63. template < class Element >
  64. Element* IVBVariableClass <Element>::targetPtr ()
  65. {
  66.   return &iTarget;
  67. }
  68.  
  69. /*------------------------------------------------------------------------------
  70. | IVBVariableClass <Element>::setTarget                                          |
  71. |                                                                              |
  72. | Sets the target attribute.                                                   |
  73. ------------------------------------------------------------------------------*/
  74. template < class Element >
  75. IVBVariableClass <Element>& IVBVariableClass <Element>::setTarget
  76.   (Element newTarget)
  77. {
  78.   iTarget = newTarget;
  79.   notifyObservers(INotificationEvent(VBINITIALIZEID, *this));
  80.   notifyObservers(INotificationEvent(targetId, *this));
  81.   return *this;
  82. }
  83.  
  84. /*------------------------------------------------------------------------------
  85. | IVBVariableClass <Element>::setTarget                                          |
  86. |                                                                              |
  87. | Sets the target attribute.                                                   |
  88. ------------------------------------------------------------------------------*/
  89. template < class Element >
  90. IVBVariableClass <Element>& IVBVariableClass <Element>::setTarget
  91.   (Element* newTarget)
  92. {
  93.   return setTarget(*newTarget);
  94. }
  95.