home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / VISBUILD / VBSAMPLE / IVBULONG.CPP < prev    next >
Text File  |  1995-05-12  |  37KB  |  767 lines

  1. /*******************************************************************************
  2. * FILE NAME: ivbulong.cpp                                                      *
  3. *                                                                              *
  4. * DESCRIPTION:                                                                 *
  5. *   Class implementation of the class(es):                                     *
  6. *    IVBUnsignedLongPart - IBM VB sample Unsigned Long part.                   *
  7. *                                                                              *
  8. * COPYRIGHT:                                                                   *
  9. *   IBM(R) VisualAge(TM) C++ for OS/2(R), Version 3                            *
  10. *   (C) Copyright IBM Corporation 1991, 1995.                                  *
  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. *   This program will not run in DOS mode.                                     *
  16. *                                                                              *
  17. * DISCLAIMER OF WARRANTIES:                                                    *
  18. *   The following [enclosed] code is sample code created by IBM                *
  19. *   Corporation.  This sample code is not part of any standard IBM product     *
  20. *   and is provided to you solely for the purpose of assisting you in the      *
  21. *   development of your applications.  The code is provided "AS IS",           *
  22. *   without warranty of any kind.  IBM shall not be liable for any damages     *
  23. *   arising out of your use of the sample code, even if they have been         *
  24. *   advised of the possibility of such damages.                                *
  25. *******************************************************************************/
  26.  
  27. #ifndef _IVBULONG_
  28.   #include <ivbulong.hpp>
  29. #endif
  30.  
  31. #ifndef _INOTIFEV_
  32.   #include <inotifev.hpp>
  33. #endif
  34.  
  35.  
  36.  
  37. /*------------------------------------------------------------------------------
  38. | IVBUnsignedLongPart::IVBUnsignedLongPart                                     |
  39. |                                                                              |
  40. | Standard constructor.                                                        |
  41. ------------------------------------------------------------------------------*/
  42. #pragma export (IVBUnsignedLongPart::IVBUnsignedLongPart(unsigned long aValue),, 2400)
  43. IVBUnsignedLongPart::IVBUnsignedLongPart(unsigned long aValue) : IVBDataTypePart ()
  44.     ,iValue (aValue)
  45.     ,iDefaultValue (0)
  46.     ,iLowLimit (0)
  47.     ,iHighLimit (ULONG_MAX)
  48. {
  49.   enableNotification ();
  50. }
  51.  
  52. /*------------------------------------------------------------------------------
  53. | IVBUnsignedLongPart::IVBUnsignedLongPart                                     |
  54. |                                                                              |
  55. | Standard copy constructor.                                                   |
  56. ------------------------------------------------------------------------------*/
  57. #pragma export (IVBUnsignedLongPart::IVBUnsignedLongPart(const IVBUnsignedLongPart&),, 2401)
  58. IVBUnsignedLongPart::IVBUnsignedLongPart (const IVBUnsignedLongPart& partCopy)
  59.   : IVBDataTypePart (partCopy)
  60.     ,iValue (partCopy.value ())
  61.     ,iDefaultValue (partCopy.defaultValue ())
  62.     ,iLowLimit (partCopy.lowLimit ())
  63.     ,iHighLimit (partCopy.highLimit ())
  64. {
  65.   enableNotification ();
  66. }
  67.  
  68. /*------------------------------------------------------------------------------
  69. | IVBUnsignedLongPart::IVBUnsignedLongPart                                     |
  70. |                                                                              |
  71. | Standard operator=                                                           |
  72. ------------------------------------------------------------------------------*/
  73. #pragma export (IVBUnsignedLongPart::operator= (const IVBUnsignedLongPart&),, 2402)
  74. IVBUnsignedLongPart& IVBUnsignedLongPart::operator= (const IVBUnsignedLongPart& aIVBUnsignedLongPart)
  75. {
  76.   if (this == &aIVBUnsignedLongPart) {
  77.     return *this;
  78.   } /* endif */
  79.   setValue(aIVBUnsignedLongPart.value());
  80.   setDefaultValue(aIVBUnsignedLongPart.defaultValue());
  81.   setLowLimit(aIVBUnsignedLongPart.lowLimit());
  82.   setHighLimit(aIVBUnsignedLongPart.highLimit());
  83.   return *this;
  84. }
  85.  
  86. /*------------------------------------------------------------------------------
  87. | IVBUnsignedLongPart::~IVBUnsignedLongPart                                    |
  88. |                                                                              |
  89. | IVBUnsignedLongPart destructor.                                              |
  90. ------------------------------------------------------------------------------*/
  91. #pragma export (IVBUnsignedLongPart::~IVBUnsignedLongPart(),, 2403)
  92. IVBUnsignedLongPart::~IVBUnsignedLongPart()
  93. {
  94. }
  95.  
  96. /*------------------------------------------------------------------------------
  97. | IVBUnsignedLongPart::asString                                                |
  98. |                                                                              |
  99. | Perform asString.                                                            |
  100. ------------------------------------------------------------------------------*/
  101. #pragma export (IVBUnsignedLongPart::asString() const,, 2404)
  102. IString IVBUnsignedLongPart::asString () const
  103. {
  104.   return valueAsText();
  105. }
  106.  
  107. /*------------------------------------------------------------------------------
  108. | IVBUnsignedLongPart::value                                                   |
  109. |                                                                              |
  110. | Return the value attribute.                                                  |
  111. ------------------------------------------------------------------------------*/
  112. #pragma export (IVBUnsignedLongPart::value() const,, 2405)
  113. unsigned long IVBUnsignedLongPart::value () const
  114. {
  115.   return iValue;
  116. }
  117.  
  118. /*------------------------------------------------------------------------------
  119. | IVBUnsignedLongPart::setValue                                                |
  120. |                                                                              |
  121. | Set the value attribute.                                                     |
  122. ------------------------------------------------------------------------------*/
  123. #pragma export (IVBUnsignedLongPart::setValue(const unsigned long),, 2406)
  124. IVBUnsignedLongPart& IVBUnsignedLongPart::setValue (unsigned long aValue)
  125. {
  126.   if (iValue != aValue) {
  127.     unsigned long oldValue = iValue;
  128.     iValue = aValue;
  129.     notifyObservers(INotificationEvent(valueId, *this,
  130.                     true, (void*)iValue));
  131.     if (iValue == 0) {
  132.       notifyObservers(INotificationEvent(valueZeroId, *this,
  133.                       true, (void*)iValue));
  134.     }
  135.     else {
  136.       if (oldValue == 0) {
  137.         notifyObservers(INotificationEvent(valueNotZeroId, *this,
  138.                         true, (void*)iValue));
  139.       } ; /* endif */
  140.     } ; /* endif */
  141.     if (iDefaultValue == iValue) {
  142.       notifyObservers(INotificationEvent(valueEqualDefaultId, *this,
  143.                       true, (void*)iValue));
  144.     }
  145.     else {
  146.       if (iDefaultValue == oldValue) {
  147.         notifyObservers(INotificationEvent(valueNotEqualDefaultId, *this,
  148.                         true, (void*)iValue));
  149.       } /* endif */
  150.     } /* endif */
  151.     if (iValue == iLowLimit) {
  152.       notifyObservers(INotificationEvent(valueEqualLowLimitId, *this,
  153.                       true, (void*)iValue));
  154.     } ; /* endif */
  155.     if (iLowLimit != 0) {
  156.       if (iValue < iLowLimit) {
  157.         if (!(oldValue < iLowLimit)) {
  158.           notifyObservers(INotificationEvent(valueBelowLowLimitId, *this,
  159.                           true, (void*)iValue));
  160.         } ; /* endif */
  161.       } ; /* endif */
  162.     } ; /* endif */
  163.     if (iValue == iHighLimit) {
  164.       notifyObservers(INotificationEvent(valueEqualHighLimitId, *this,
  165.                       true, (void*)iValue));
  166.     } ; /* endif */
  167.     if (iHighLimit != ULONG_MAX) {
  168.       if (iValue > iHighLimit) {
  169.         if (!(oldValue > iHighLimit)) {
  170.           notifyObservers(INotificationEvent(valueAboveHighLimitId, *this,
  171.                           true, (void*)iValue));
  172.         } ; /* endif */
  173.       } ; /* endif */
  174.     } ; /* endif */
  175.     if ((iValue >= iLowLimit) && (iValue <= iHighLimit)) {
  176.       if (!((oldValue >= iLowLimit) && (oldValue <= iHighLimit))) {
  177.         notifyObservers(INotificationEvent(valueWithinLimitsId, *this,
  178.                         true, (void*)iValue));
  179.       } ; /* endif */
  180.     }
  181.     else {
  182.       if (((oldValue >= iLowLimit) && (oldValue <= iHighLimit))) {
  183.         notifyObservers(INotificationEvent(valueOutsideLimitsId, *this,
  184.                         true, (void*)iValue));
  185.       } ; /* endif */
  186.     } ; /* endif */
  187.   } ; /* endif */
  188.   return *this;
  189. }
  190.  
  191. /*------------------------------------------------------------------------------
  192. | IVBUnsignedLongPart::setValue                                                |
  193. |                                                                              |
  194. | Set the value attribute.                                                     |
  195. ------------------------------------------------------------------------------*/
  196. #pragma export (IVBUnsignedLongPart::setValue(),, 2407)
  197. IVBUnsignedLongPart& IVBUnsignedLongPart::setValue ()
  198. {
  199.   return setValue(defaultValue());
  200. }
  201.  
  202. /*------------------------------------------------------------------------------
  203. | IVBUnsignedLongPart::valueAsText                                             |
  204. |                                                                              |
  205. | Return the valueAsText attribute.                                            |
  206. ------------------------------------------------------------------------------*/
  207. #pragma export (IVBUnsignedLongPart::valueAsText() const,, 2408)
  208. IString IVBUnsignedLongPart::valueAsText () const
  209. {
  210.   return IString (value());
  211. }
  212.  
  213. /*------------------------------------------------------------------------------
  214. | IVBUnsignedLongPart::setValueAsText                                          |
  215. |                                                                              |
  216. | Set the valueAsText attribute.                                               |
  217. ------------------------------------------------------------------------------*/
  218. #pragma export (IVBUnsignedLongPart::setValueAsText(const IString&),, 2409)
  219. IVBUnsignedLongPart& IVBUnsignedLongPart::setValueAsText (const IString& aValueAsText)
  220. {
  221.   setValue (aValueAsText.asUnsigned());
  222.   Boolean iValid = aValueAsText.indexOfAnyBut("+0123456789 ");
  223.   if (iValid) {
  224.     IString eventData(aValueAsText);
  225.     notifyObservers(INotificationEvent(inputStringNotValidId, *this,
  226.                       true, (void*)&eventData));
  227.   } else {
  228.     IString eventData(aValueAsText);
  229.     notifyObservers(INotificationEvent(inputStringIsValidId, *this,
  230.                       true, (void*)&eventData));
  231.   } /* endif */
  232.   return *this;
  233. }
  234.  
  235. /*------------------------------------------------------------------------------
  236. | IVBUnsignedLongPart::setValueAsText                                          |
  237. |                                                                              |
  238. | Set the valueAsText attribute.                                               |
  239. ------------------------------------------------------------------------------*/
  240. #pragma export (IVBUnsignedLongPart::setValueAsText(const IString*),, 2410)
  241. IVBUnsignedLongPart& IVBUnsignedLongPart::setValueAsText (const IString* aValueAsText)
  242. {
  243.   return setValueAsText (*aValueAsText);
  244. }
  245.  
  246. /*------------------------------------------------------------------------------
  247. | IVBUnsignedLongPart::valueAs1Based                                           |
  248. |                                                                              |
  249. | Return the valueAs1Based attribute.                                          |
  250. ------------------------------------------------------------------------------*/
  251. #pragma export (IVBUnsignedLongPart::valueAs1Based() const,, 2411)
  252. unsigned long IVBUnsignedLongPart::valueAs1Based () const
  253. {
  254.   return (value() + 1) ;
  255. }
  256.  
  257. /*------------------------------------------------------------------------------
  258. | IVBUnsignedLongPart::setValueAs1Based                                        |
  259. |                                                                              |
  260. | Set the valueAs1Based attribute.                                             |
  261. ------------------------------------------------------------------------------*/
  262. #pragma export (IVBUnsignedLongPart::setValueAs1Based(unsigned long),, 2412)
  263. IVBUnsignedLongPart& IVBUnsignedLongPart::setValueAs1Based (unsigned long aValueAs1Based)
  264. {
  265.   return setValue (aValueAs1Based - 1);
  266. }
  267.  
  268. /*------------------------------------------------------------------------------
  269. | IVBUnsignedLongPart::defaultValue                                            |
  270. |                                                                              |
  271. | Return the defaultValue attribute.                                           |
  272. ------------------------------------------------------------------------------*/
  273. #pragma export (IVBUnsignedLongPart::defaultValue() const,, 2413)
  274. unsigned long IVBUnsignedLongPart::defaultValue () const
  275. {
  276.   return iDefaultValue;
  277. }
  278.  
  279. /*------------------------------------------------------------------------------
  280. | IVBUnsignedLongPart::setDefaultValue                                         |
  281. |                                                                              |
  282. | Set the defaultValue attribute.                                              |
  283. ------------------------------------------------------------------------------*/
  284. #pragma export (IVBUnsignedLongPart::setDefaultValue(const unsigned long),, 2414)
  285. IVBUnsignedLongPart& IVBUnsignedLongPart::setDefaultValue (unsigned long aDefaultValue)
  286. {
  287.   if (iDefaultValue != aDefaultValue) {
  288.     unsigned long oldValue = iDefaultValue;
  289.     iDefaultValue = aDefaultValue;
  290.     notifyObservers(INotificationEvent(defaultValueId, *this,
  291.                       true, (void*)iDefaultValue));
  292.     if (iDefaultValue == iValue) {
  293.       notifyObservers(INotificationEvent(valueEqualDefaultId, *this,
  294.                       true, (void*)iValue));
  295.     }
  296.     else {
  297.       if (oldValue == iValue) {
  298.         notifyObservers(INotificationEvent(valueNotEqualDefaultId, *this,
  299.                         true, (void*)iValue));
  300.       } /* endif */
  301.     } /* endif */
  302.   } /* endif */
  303.   return *this;
  304. }
  305.  
  306. /*------------------------------------------------------------------------------
  307. | IVBUnsignedLongPart::isValueEqualDefault                                     |
  308. |                                                                              |
  309. | Return the valueEqualDefault attribute.                                      |
  310. ------------------------------------------------------------------------------*/
  311. #pragma export (IVBUnsignedLongPart::isValueEqualDefault() const,, 2415)
  312. Boolean IVBUnsignedLongPart::isValueEqualDefault () const
  313. {
  314.   return (value() == defaultValue ()) ;
  315. }
  316.  
  317. /*------------------------------------------------------------------------------
  318. | IVBUnsignedLongPart::isValueNotEqualDefault                                  |
  319. |                                                                              |
  320. | Return the valueNotEqualDefault attribute.                                   |
  321. ------------------------------------------------------------------------------*/
  322. #pragma export (IVBUnsignedLongPart::isValueNotEqualDefault() const,, 2416)
  323. Boolean IVBUnsignedLongPart::isValueNotEqualDefault () const
  324. {
  325.   return (value() != defaultValue ()) ;
  326. }
  327.  
  328. /*------------------------------------------------------------------------------
  329. | IVBUnsignedLongPart::lowLimit                                                |
  330. |                                                                              |
  331. | Return the lowLimit attribute.                                               |
  332. ------------------------------------------------------------------------------*/
  333. #pragma export (IVBUnsignedLongPart::lowLimit() const,, 2417)
  334. unsigned long IVBUnsignedLongPart::lowLimit () const
  335. {
  336.   return iLowLimit;
  337. }
  338.  
  339. /*------------------------------------------------------------------------------
  340. | IVBUnsignedLongPart::setLowLimit                                             |
  341. |                                                                              |
  342. | Set the lowLimit attribute.                                                  |
  343. ------------------------------------------------------------------------------*/
  344. #pragma export (IVBUnsignedLongPart::setLowLimit(const unsigned long),, 2418)
  345. IVBUnsignedLongPart& IVBUnsignedLongPart::setLowLimit (unsigned long aLowLimit)
  346. {
  347.   if (iLowLimit != aLowLimit) {
  348.     unsigned long oldValue = iLowLimit;
  349.     iLowLimit = aLowLimit;
  350.     notifyObservers(INotificationEvent(lowLimitId, *this,
  351.                       true, (void*)iLowLimit));
  352.     if (iValue == lowLimit()) {
  353.       notifyObservers(INotificationEvent(valueEqualLowLimitId, *this,
  354.                       true, (void*)iValue));
  355.     } ; /* endif */
  356.     if (lowLimit() != 0) {
  357.       if (iValue < iLowLimit) {
  358.         if (!(iValue < oldValue)) {
  359.           notifyObservers(INotificationEvent(valueBelowLowLimitId, *this,
  360.                           true, (void*)iValue));
  361.         } ; /* endif */
  362.       } ; /* endif */
  363.     } ; /* endif */
  364.     if ((iValue >= lowLimit()) && (iValue <= highLimit())) {
  365.       if (!((iValue >= oldValue) && (iValue <= highLimit()))) {
  366.         notifyObservers(INotificationEvent(valueWithinLimitsId, *this,
  367.                         true, (void*)iLowLimit));
  368.       } ; /* endif */
  369.     }
  370.     else {
  371.       if ((iValue >= oldValue) && (iValue <= highLimit())) {
  372.         notifyObservers(INotificationEvent(valueOutsideLimitsId, *this,
  373.                         true, (void*)iLowLimit));
  374.       } ; /* endif */
  375.     } ; /* endif */
  376.   } /* endif */
  377.   return *this;
  378. }
  379.  
  380. /*------------------------------------------------------------------------------
  381. | IVBUnsignedLongPart::highLimit                                               |
  382. |                                                                              |
  383. | Return the highLimit attribute.                                              |
  384. ------------------------------------------------------------------------------*/
  385. #pragma export (IVBUnsignedLongPart::highLimit() const,, 2419)
  386. unsigned long IVBUnsignedLongPart::highLimit () const
  387. {
  388.   return iHighLimit;
  389. }
  390.  
  391. /*------------------------------------------------------------------------------
  392. | IVBUnsignedLongPart::setHighLimit                                            |
  393. |                                                                              |
  394. | Set the highLimit attribute.                                                 |
  395. ------------------------------------------------------------------------------*/
  396. #pragma export (IVBUnsignedLongPart::setHighLimit(const unsigned long),, 2420)
  397. IVBUnsignedLongPart& IVBUnsignedLongPart::setHighLimit (unsigned long aHighLimit)
  398. {
  399.   if (iHighLimit != aHighLimit) {
  400.     unsigned long oldValue = iHighLimit;
  401.     iHighLimit = aHighLimit;
  402.     notifyObservers(INotificationEvent(highLimitId, *this,
  403.                       true, (void*)iHighLimit));
  404.     if (iValue == highLimit()) {
  405.       notifyObservers(INotificationEvent(valueEqualHighLimitId, *this,
  406.                       true, (void*)iValue));
  407.     } ; /* endif */
  408.     if (highLimit() != ULONG_MAX) {
  409.       if (iValue > iHighLimit) {
  410.         if (!(iValue > oldValue)) {
  411.           notifyObservers(INotificationEvent(valueAboveHighLimitId, *this,
  412.                           true, (void*)iValue));
  413.         } ; /* endif */
  414.       } ; /* endif */
  415.     } ; /* endif */
  416.     if ((iValue >= lowLimit()) && (iValue <= highLimit())) {
  417.       if (!((iValue >= lowLimit()) && (iValue <= oldValue))) {
  418.         notifyObservers(INotificationEvent(valueWithinLimitsId, *this,
  419.                         true, (void*)iHighLimit));
  420.       } ; /* endif */
  421.     }
  422.     else {
  423.       if ((iValue >= lowLimit()) && (iValue <= oldValue)) {
  424.         notifyObservers(INotificationEvent(valueOutsideLimitsId, *this,
  425.                         true, (void*)iHighLimit));
  426.       } ; /* endif */
  427.     } ; /* endif */
  428.   } /* endif */
  429.   return *this;
  430. }
  431.  
  432. /*------------------------------------------------------------------------------
  433. | IVBUnsignedLongPart::isValueEqualLowLimit                                    |
  434. |                                                                              |
  435. | Return the valueEqualLowLimit attribute.                                     |
  436. ------------------------------------------------------------------------------*/
  437. #pragma export (IVBUnsignedLongPart::isValueEqualLowLimit() const,, 2421)
  438. Boolean IVBUnsignedLongPart::isValueEqualLowLimit () const
  439. {
  440.   return (value() == lowLimit ()) ;
  441. }
  442.  
  443. /*------------------------------------------------------------------------------
  444. | IVBUnsignedLongPart::isValueEqualHighLimit                                   |
  445. |                                                                              |
  446. | Return the valueEqualHighLimit attribute.                                    |
  447. ------------------------------------------------------------------------------*/
  448. #pragma export (IVBUnsignedLongPart::isValueEqualHighLimit() const,, 2422)
  449. Boolean IVBUnsignedLongPart::isValueEqualHighLimit () const
  450. {
  451.   return (value() == highLimit ()) ;
  452. }
  453.  
  454. /*------------------------------------------------------------------------------
  455. | IVBUnsignedLongPart::isValueBelowLowLimit                                    |
  456. |                                                                              |
  457. | Return the valueBelowLowLimit attribute.                                     |
  458. ------------------------------------------------------------------------------*/
  459. #pragma export (IVBUnsignedLongPart::isValueBelowLowLimit() const,, 2423)
  460. Boolean IVBUnsignedLongPart::isValueBelowLowLimit () const
  461. {
  462.   return (value() < lowLimit ()) ;
  463. }
  464.  
  465. /*------------------------------------------------------------------------------
  466. | IVBUnsignedLongPart::isValueAboveHighLimit                                   |
  467. |                                                                              |
  468. | Return the valueAboveHighLimit attribute.                                    |
  469. ------------------------------------------------------------------------------*/
  470. #pragma export (IVBUnsignedLongPart::isValueAboveHighLimit() const,, 2424)
  471. Boolean IVBUnsignedLongPart::isValueAboveHighLimit () const
  472. {
  473.   return (value() > highLimit ()) ;
  474. }
  475.  
  476. /*------------------------------------------------------------------------------
  477. | IVBUnsignedLongPart::isValueOutsideLimits                                    |
  478. |                                                                              |
  479. | Return the valueOutsideLimits attribute.                                     |
  480. ------------------------------------------------------------------------------*/
  481. #pragma export (IVBUnsignedLongPart::isValueOutsideLimits() const,, 2425)
  482. Boolean IVBUnsignedLongPart::isValueOutsideLimits () const
  483. {
  484.   return ((value() < lowLimit()) || (value() > highLimit())) ;
  485. }
  486.  
  487. /*------------------------------------------------------------------------------
  488. | IVBUnsignedLongPart::isValueWithinLimits                                     |
  489. |                                                                              |
  490. | Return the valueWithinLimits attribute.                                      |
  491. ------------------------------------------------------------------------------*/
  492. #pragma export (IVBUnsignedLongPart::isValueWithinLimits() const,, 2426)
  493. Boolean IVBUnsignedLongPart::isValueWithinLimits () const
  494. {
  495.   return !isValueOutsideLimits ();
  496. }
  497.  
  498. /*------------------------------------------------------------------------------
  499. | IVBUnsignedLongPart::isValueNotZero                                          |
  500. |                                                                              |
  501. | Return the valueNotZero attribute.                                           |
  502. ------------------------------------------------------------------------------*/
  503. #pragma export (IVBUnsignedLongPart::isValueNotZero() const,, 2427)
  504. Boolean IVBUnsignedLongPart::isValueNotZero () const
  505. {
  506.   return (value() != 0) ;
  507. }
  508.  
  509. /*------------------------------------------------------------------------------
  510. | IVBUnsignedLongPart::isValueZero                                             |
  511. |                                                                              |
  512. | Return the valueZero attribute.                                              |
  513. ------------------------------------------------------------------------------*/
  514. #pragma export (IVBUnsignedLongPart::isValueZero() const,, 2428)
  515. Boolean IVBUnsignedLongPart::isValueZero () const
  516. {
  517.   return (value() == 0) ;
  518. }
  519.  
  520. /*------------------------------------------------------------------------------
  521. | IVBUnsignedLongPart::assignValueToZero                                       |
  522. |                                                                              |
  523. | Assign the value attribute to 0.                                             |
  524. ------------------------------------------------------------------------------*/
  525. #pragma export (IVBUnsignedLongPart::assignValueToZero(),, 2429)
  526. IVBUnsignedLongPart& IVBUnsignedLongPart::assignValueToZero ()
  527. {
  528.   return setValue (0) ;
  529. }
  530.  
  531. /*------------------------------------------------------------------------------
  532. | IVBUnsignedLongPart::assignValueToOne                                        |
  533. |                                                                              |
  534. | Assign the value attribute to 1.                                             |
  535. ------------------------------------------------------------------------------*/
  536. #pragma export (IVBUnsignedLongPart::assignValueToOne(),, 2430)
  537. IVBUnsignedLongPart& IVBUnsignedLongPart::assignValueToOne ()
  538. {
  539.   return setValue (1) ;
  540. }
  541.  
  542. /*------------------------------------------------------------------------------
  543. | IVBUnsignedLongPart::assignValueToLowLimit                                   |
  544. |                                                                              |
  545. | Assign the value attribute to low limit attribute.                           |
  546. ------------------------------------------------------------------------------*/
  547. #pragma export (IVBUnsignedLongPart::assignValueToLowLimit(),, 2431)
  548. IVBUnsignedLongPart& IVBUnsignedLongPart::assignValueToLowLimit ()
  549. {
  550.   return setValue (lowLimit()) ;
  551. }
  552.  
  553. /*------------------------------------------------------------------------------
  554. | IVBUnsignedLongPart::assignValueToHighLimit                                  |
  555. |                                                                              |
  556. | Assign the value attribute to high limit attribute.                          |
  557. ------------------------------------------------------------------------------*/
  558. #pragma export (IVBUnsignedLongPart::assignValueToHighLimit(),, 2432)
  559. IVBUnsignedLongPart& IVBUnsignedLongPart::assignValueToHighLimit ()
  560. {
  561.   return setValue (highLimit()) ;
  562. }
  563.  
  564. /*------------------------------------------------------------------------------
  565. | IVBUnsignedLongPart::assignValueToDefault                                    |
  566. |                                                                              |
  567. | Assign the value attribute to default.                                       |
  568. ------------------------------------------------------------------------------*/
  569. #pragma export (IVBUnsignedLongPart::assignValueToDefault(),, 2433)
  570. IVBUnsignedLongPart& IVBUnsignedLongPart::assignValueToDefault ()
  571. {
  572.   return setValue (defaultValue ()) ;
  573. }
  574.  
  575. /*------------------------------------------------------------------------------
  576. | IVBUnsignedLongPart::assignValueToRandom                                     |
  577. |                                                                              |
  578. | Assign the value attribute to a pseudo-random number.                        |
  579. ------------------------------------------------------------------------------*/
  580. #pragma export (IVBUnsignedLongPart::assignValueToRandom(),, 2434)
  581. IVBUnsignedLongPart& IVBUnsignedLongPart::assignValueToRandom ()
  582. {
  583.   return setValue (rand ()) ;
  584. }
  585.  
  586. /*------------------------------------------------------------------------------
  587. | IVBUnsignedLongPart::copyValueToDefault                                      |
  588. |                                                                              |
  589. | Copy the value attribute to default.                                         |
  590. ------------------------------------------------------------------------------*/
  591. #pragma export (IVBUnsignedLongPart::copyValueToDefault(),, 2435)
  592. IVBUnsignedLongPart& IVBUnsignedLongPart::copyValueToDefault ()
  593. {
  594.   return setDefaultValue (value()) ;
  595. }
  596.  
  597. /*------------------------------------------------------------------------------
  598. | IVBUnsignedLongPart::squareValue                                             |
  599. |                                                                              |
  600. | Square the value attribute.                                                  |
  601. ------------------------------------------------------------------------------*/
  602. #pragma export (IVBUnsignedLongPart::squareValue(),, 2436)
  603. IVBUnsignedLongPart& IVBUnsignedLongPart::squareValue()
  604. {
  605.   return setValue (value() * value()) ;
  606. }
  607.  
  608. /*------------------------------------------------------------------------------
  609. | IVBUnsignedLongPart::addValue                                                |
  610. |                                                                              |
  611. | Perform the add operator to the value attribute.                             |
  612. ------------------------------------------------------------------------------*/
  613. #pragma export (IVBUnsignedLongPart::addValue (unsigned long),, 2437)
  614. IVBUnsignedLongPart& IVBUnsignedLongPart::addValue (unsigned long addValue)
  615. {
  616.   return setValue (value() + addValue) ;
  617. }
  618.  
  619. /*------------------------------------------------------------------------------
  620. | IVBUnsignedLongPart::subtractValue                                           |
  621. |                                                                              |
  622. | Perform the subtract operator to the value attribute.                        |
  623. ------------------------------------------------------------------------------*/
  624. #pragma export (IVBUnsignedLongPart::subtractValue (unsigned long),, 2438)
  625. IVBUnsignedLongPart& IVBUnsignedLongPart::subtractValue (unsigned long subtractValue)
  626. {
  627.   return setValue (value() - subtractValue) ;
  628. }
  629.  
  630. /*------------------------------------------------------------------------------
  631. | IVBUnsignedLongPart::multiplyValue                                           |
  632. |                                                                              |
  633. | Perform the multiply operator to the value attribute.                        |
  634. ------------------------------------------------------------------------------*/
  635. #pragma export (IVBUnsignedLongPart::multiplyValue (unsigned long),, 2439)
  636. IVBUnsignedLongPart& IVBUnsignedLongPart::multiplyValue (unsigned long multiplyValue)
  637. {
  638.   return setValue (value() * multiplyValue) ;
  639. }
  640.  
  641. /*------------------------------------------------------------------------------
  642. | IVBUnsignedLongPart::divideValue                                            |
  643. |                                                                             |
  644. | Perform the divide operator to the value attribute.                         |
  645. ------------------------------------------------------------------------------*/
  646. #pragma export (IVBUnsignedLongPart::divideValue (unsigned long),, 2440)
  647. IVBUnsignedLongPart& IVBUnsignedLongPart::divideValue (unsigned long divideValue)
  648. {
  649.   if (divideValue)
  650.     return setValue (value() / divideValue) ;
  651.   return *this;
  652. }
  653.  
  654. /*------------------------------------------------------------------------------
  655. | IVBUnsignedLongPart::andValue                                                |
  656. |                                                                              |
  657. | Perform the and operator to the value attribute.                             |
  658. ------------------------------------------------------------------------------*/
  659. #pragma export (IVBUnsignedLongPart::andValue (unsigned long),, 2441)
  660. IVBUnsignedLongPart& IVBUnsignedLongPart::andValue (unsigned long andValue)
  661. {
  662.   return setValue (value() & andValue) ;
  663. }
  664.  
  665. /*------------------------------------------------------------------------------
  666. | IVBUnsignedLongPart::orValue                                                 |
  667. |                                                                              |
  668. | Perform the or operator to the value attribute.                              |
  669. ------------------------------------------------------------------------------*/
  670. #pragma export (IVBUnsignedLongPart::orValue (unsigned long),, 2442)
  671. IVBUnsignedLongPart& IVBUnsignedLongPart::orValue (unsigned long orValue)
  672. {
  673.   return setValue (value() | orValue) ;
  674. }
  675.  
  676. /*------------------------------------------------------------------------------
  677. | IVBUnsignedLongPart::operator == (const IVBUnsignedLongPart & aValue)        |
  678. |                                                                              |
  679. ------------------------------------------------------------------------------*/
  680. #pragma export (IVBUnsignedLongPart::operator == (const IVBUnsignedLongPart&) const,, 2443)
  681. Boolean IVBUnsignedLongPart::
  682.   operator == (const IVBUnsignedLongPart& aValue) const
  683. {
  684.   if (value() != aValue.value()) {
  685.     return false;
  686.   } /* endif */
  687.   if (defaultValue() != aValue.defaultValue()) {
  688.     return false;
  689.   } /* endif */
  690.   if (lowLimit() != aValue.lowLimit()) {
  691.     return false;
  692.   } /* endif */
  693.   if (highLimit() != aValue.highLimit()) {
  694.     return false;
  695.   } /* endif */
  696.   return true;
  697. }
  698.  
  699. /*------------------------------------------------------------------------------
  700. | IVBUnsignedLongPart::operator != (const IVBUnsignedLongPart & aValue)        |
  701. |                                                                              |
  702. ------------------------------------------------------------------------------*/
  703. #pragma export (IVBUnsignedLongPart::operator != (const IVBUnsignedLongPart&) const,, 2444)
  704. Boolean IVBUnsignedLongPart::
  705.   operator != (const IVBUnsignedLongPart& aValue) const
  706. {
  707.   if (value() != aValue.value()) {
  708.     return true;
  709.   } /* endif */
  710.   if (defaultValue() != aValue.defaultValue()) {
  711.     return true;
  712.   } /* endif */
  713.   if (lowLimit() != aValue.lowLimit()) {
  714.     return true;
  715.   } /* endif */
  716.   if (highLimit() != aValue.highLimit()) {
  717.     return true;
  718.   } /* endif */
  719.   return false;
  720. }
  721.  
  722. /*------------------------------------------------------------------------------
  723. | IVBUnsignedLongPart::operator == (const IVBUnsignedLongPart * aValue)        |
  724. |                                                                              |
  725. ------------------------------------------------------------------------------*/
  726. #pragma export (IVBUnsignedLongPart::operator == (const IVBUnsignedLongPart*) const,, 2445)
  727. Boolean IVBUnsignedLongPart::
  728.   operator == (const IVBUnsignedLongPart* aValue) const
  729. {
  730.   if (value() != aValue->value()) {
  731.     return false;
  732.   } /* endif */
  733.   if (defaultValue() != aValue->defaultValue()) {
  734.     return false;
  735.   } /* endif */
  736.   if (lowLimit() != aValue->lowLimit()) {
  737.     return false;
  738.   } /* endif */
  739.   if (highLimit() != aValue->highLimit()) {
  740.     return false;
  741.   } /* endif */
  742.   return true;
  743. }
  744.  
  745. /*------------------------------------------------------------------------------
  746. | IVBUnsignedLongPart::operator != (const IVBUnsignedLongPart * aValue)        |
  747. |                                                                              |
  748. ------------------------------------------------------------------------------*/
  749. #pragma export (IVBUnsignedLongPart::operator != (const IVBUnsignedLongPart*) const,, 2446)
  750. Boolean IVBUnsignedLongPart::
  751.   operator != (const IVBUnsignedLongPart* aValue) const
  752. {
  753.   if (value() != aValue->value()) {
  754.     return true;
  755.   } /* endif */
  756.   if (defaultValue() != aValue->defaultValue()) {
  757.     return true;
  758.   } /* endif */
  759.   if (lowLimit() != aValue->lowLimit()) {
  760.     return true;
  761.   } /* endif */
  762.   if (highLimit() != aValue->highLimit()) {
  763.     return true;
  764.   } /* endif */
  765.   return false;
  766. }
  767.