home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IVBSHORT_
- #define _IVBSHORT_
- /*******************************************************************************
- * FILE NAME: ivbshort.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IVBShortPart - IBM VB sample Short part. *
- * *
- * COPYRIGHT: *
- * IBM(R) VisualAge(TM) for C++ *
- * (C) Copyright International Business Machines Corporation 1991, 1996 *
- * Licensed Material - Program-Property of IBM - All Rights Reserved. *
- * US Government Users Restricted Rights - Use, duplication, or disclosure *
- * restricted by GSA ADP Schedule Contract with IBM Corp. *
- * *
- * This program will not run in DOS mode. *
- * *
- * DISCLAIMER OF WARRANTIES: *
- * The following [enclosed] code is sample code created by IBM *
- * Corporation. This sample code is not part of any standard IBM product *
- * and is provided to you solely for the purpose of assisting you in the *
- * development of your applications. The code is provided "AS IS", *
- * without warranty of any kind. IBM shall not be liable for any damages *
- * arising out of your use of the sample code, even if they have been *
- * advised of the possibility of such damages. *
- *******************************************************************************/
-
- #ifndef _IVBDTYPE_
- #include <ivbdtype.hpp>
- #endif
-
- #ifndef __limits_h
- #include <limits.h>
- #endif
-
- #ifndef _ISTRING_
- #include <istring.hpp>
- #endif
-
- /*-------------------------- Pragma Library Support --------------------------*/
- #ifndef __NO_DEFAULT_LIBS__
- #ifdef __OS2__
- #ifdef __IMPORTLIB__
- #pragma library("CPPOV03I.LIB")
- #else
- #pragma library("CPPOV03.LIB")
- #endif
- #endif
- #ifdef __WINDOWS__
- #ifdef __IMPORTLIB__
- #pragma library("CPPWV03I.LIB")
- #else
- #pragma library("CPPWV03.LIB")
- #endif
- #endif
- #endif
-
-
- /*----------------------------------------------------------------------------*/
- /* Align classes on four byte boundary. */
- /*----------------------------------------------------------------------------*/
- #pragma pack(4)
-
- class IVBShortPart : public IVBDataTypePart
- {
- typedef IVBDataTypePart
- Inherited;
- public:
- /*--------------------------- PUBLIC -----------------------------------------*/
-
- /*------------------------- Constructors/Destructor ----------------------------
- ------------------------------------------------------------------------------*/
- IVBShortPart (short value = 0);
- IVBShortPart (const IVBShortPart& partCopy);
- virtual
- ~IVBShortPart ();
-
- /*-------------------------------- Operators -----------------------------------
- | operator == - Operator == (return true if equal). |
- | operator != - Operator != (return true if not equal). |
- ------------------------------------------------------------------------------*/
- IVBShortPart& operator= (const IVBShortPart& aIVBShortPart);
- Boolean
- operator == (const IVBShortPart& aValue) const,
- operator != (const IVBShortPart& aValue) const,
- operator == (const IVBShortPart* aValue) const,
- operator != (const IVBShortPart* aValue) const;
-
- virtual IString
- asString ( ) const;
-
- /*-------------------------------- Attributes ----------------------------------
- | List of query and set members functions for this class: |
- | |
- | value - Query the value (short) attribute. |
- | valueAsText - Query the valueAsText (IString) attribute. |
- | valueAs1Based - Query the valueAs1Based (short) attribute. |
- | defaultValue - Query the defaultValue (short) attribute. |
- | isValueEqualDefault - Query the valueEqualDefault (Boolean) attribute. |
- | isValueNotEqualDefault - Query the valueNotEqualDefault (Boolean) attribute. |
- | lowLimit - Query the lowLimit (short) attribute. |
- | highLimit - Query the highLimit (short) attribute. |
- | isValueEqualLowLimit - Query the valueEqualLowLimit (Boolean) attribute. |
- | isValueEqualHighLimit - Query the valueEqualHighLimit (Boolean) attribute. |
- | isValueBelowLowLimit - Query the valueBelowLowLimit (Boolean) attribute. |
- | isValueAboveHighLimit - Query the valueAboveHighLimit (Boolean) attribute. |
- | isValueOutsideLimits - Query the valueOutsideLimits (Boolean) attribute. |
- | isValueWithinLimits - Query the valueWithinLimits (Boolean) attribute. |
- | isValueNotZero - Query the valueNotZero (Boolean) attribute. |
- | isValueZero - Query the valueZero (Boolean) attribute. |
- | isValuePositive - Query the valuePositive (Boolean) attribute. |
- | isValueNegative - Query the valueNegative (Boolean) attribute. |
- | setValue - Set the value (short) attribute. |
- | setValueAsText - Set the valueAsText (IString) attribute. |
- | setValueAs1Based - Set the valueAs1Based (short) attribute. |
- | setDefaultValue - Set the defaultValue (short) attribute. |
- | setLowLimit - Set the lowLimit (short) attribute. |
- | setHighLimit - Set the highLimit (short) attribute. |
- ------------------------------------------------------------------------------*/
-
- virtual short
- value () const;
- virtual IVBShortPart
- &setValue (short aValue),
- &setValue ();
-
- virtual IString
- valueAsText () const;
- virtual IVBShortPart
- &setValueAsText (const IString& valueAsText),
- &setValueAsText (const IString* valueAsText);
-
- virtual short
- valueAs1Based () const;
- virtual IVBShortPart
- &setValueAs1Based (short valueAs1Based);
-
- virtual short
- defaultValue () const;
- virtual IVBShortPart
- &setDefaultValue (short defaultValue = 0);
-
- virtual Boolean
- isValueEqualDefault () const;
-
- virtual Boolean
- isValueNotEqualDefault () const;
-
- virtual short
- lowLimit () const;
- virtual IVBShortPart
- &setLowLimit (short aLowLimit = SHRT_MIN);
-
- virtual short
- highLimit () const;
- virtual IVBShortPart
- &setHighLimit (short highLimit = SHRT_MAX);
-
- virtual Boolean
- isValueEqualLowLimit () const;
-
- virtual Boolean
- isValueEqualHighLimit () const;
-
- virtual Boolean
- isValueBelowLowLimit () const;
-
- virtual Boolean
- isValueAboveHighLimit () const;
-
- virtual Boolean
- isValueOutsideLimits () const;
-
- virtual Boolean
- isValueWithinLimits () const;
-
- virtual Boolean
- isValueNotZero () const;
-
- virtual Boolean
- isValueZero () const;
-
- virtual Boolean
- isValuePositive () const;
-
- virtual Boolean
- isValueNegative () const;
-
- /*-------------------------------- Actions -------------------------------------
- | List of operations or services provided by this class: |
- | |
- | assignValueToZero - Assign value attribute to 0 (false). |
- | assignValueToOne - Assign value attribute to 1 (true). |
- | assignValueToLowLimit - Assign value attribute to low limit. |
- | assignValueToHighLimit - Assign value attribute to high limit |
- | assignValueToDefault - Assign the value attribute to false. |
- | assignValueToRandom - Assign value to pseudo-random number |
- | copyValueToDefault - Copy value to default value. |
- | squareValue - Square the value attribute. |
- | andValue - Perform and operator on value. |
- | orValue - Perform or operator on value. |
- | addValue - Perform add operator on value. |
- | subractValue - Perform subract operator on value. |
- | divideValue - Perform divide operator on value. |
- | multiplyValue - Perform multiply operator on value. |
- ------------------------------------------------------------------------------*/
-
- virtual IVBShortPart
- &assignValueToZero (),
- &assignValueToOne (),
- &assignValueToLowLimit (),
- &assignValueToHighLimit (),
- &assignValueToDefault (),
- &assignValueToRandom (),
- ©ValueToDefault (),
- &squareValue (),
- &andValue (short andValue = 1),
- &orValue (short orValue = 1),
- &addValue (short addValue = 1),
- &subtractValue (short subtractValue = 1),
- &multiplyValue (short multiplyValue = 2),
- ÷Value (short divideValue = 2);
-
- /*----------------------- Notification Event Descriptions ----------------------
- | List of attribute and event notification identifiers: |
- | |
- ------------------------------------------------------------------------------*/
-
-
- private:
- /*--------------------------- PRIVATE ----------------------------------------*/
- short iValue; //Data member for value attribute
- short iDefaultValue; //Data member for defaultValue attribute
- short iLowLimit; //Data member for lowLimit attribute
- short iHighLimit; //Data member for highLimit attribute
- };
-
- /*----------------------------------------------------------------------------*/
- /* Resume compiler default packing. */
- /*----------------------------------------------------------------------------*/
- #pragma pack()
-
- #endif
-