The ITInt8 class

Base class: none

Encapsulates 8-byte integer value. This class can be used in any client application, although only HCL Informix® supports the int8 data type.

This class provides the following methods.
Method Description
ITInt8() Creates uninitialized instance of ITInt8.
ITInt8 &operator=(<<type>) Sets ITInt8 to the value of <type>, where <type> is one of the following:
  • int
  • long
  • float
  • double
  • mi_int8
  • IT_LONG_LONG
where IT_LONG_LONG is a compiler-provided 8-byte integer (if any). The result of the conversion might not fit into the type specified by <type>.
IsNull() Returns TRUE if an object does not represent a valid 8-byte integer.
Conversion operators ITInt8 provides conversions to the value of one of the following types:
  • int
  • long
  • float
  • double
  • mi_int8
  • ITString
  • IT_LONG_LONG
Other operators ITInt8 provides assignment comparison, and arithmetic operators. The results of arithmetic operations on ITInt8 objects might not fit into 8 bytes, in which case, the result would not be a valid ITInt8 object.

In Version 2.70, you can use new constructors to create objects by using each of the built-in numeric types as initialization arguments. This eliminates the need to explicitly assign a numeric type that is not an int8 (for example, int) to an ITInt8 object before comparing it with an ITInt8 object.

The new constructors are:
 ITInt8( const int );
     ITInt8( const long );
     ITInt8( const float );
     ITInt8( const double );
     ITInt8( const mi_int8 );
     ITInt8( const ITString & );
     #ifdef IT_COMPILER_HAS_LONG_LONG
     ITInt8( const IT_LONG_LONG );
     #endif
Before version 2.70, to initialize an ITInt8 object, the application must assign a value to an ITInt8 object by using the assignment operator (=), as follows:
int i = 100;
     ITInt8 i8;
     i8 = i;
     if ( i8 == (ITInt8)i )
With Version 2.70 and later, the assignment can be replaced by an ITInt8 constructor call:
int i = 100;
     ITInt8 i8(i); // or ITInt8 i8(100);
     if ( i8 == (ITInt8)i )