Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/DataType/Array/ArrayInt.h

Go to the documentation of this file.
00001 // Should be made as a MACRO
00002 // once fully debugged
00003 
00004 // Simple class Array (for integers)
00005 #ifndef ARRAY1_H
00006 #define ARRAY1_H
00007 
00008 #include <iostream.h>
00009 
00010 class Array {
00011    friend ostream &operator<<( ostream &, const Array & );
00012    friend istream &operator>>( istream &, Array & );
00013 public:
00014    Array( int = 10 );                   // default constructor
00015    Array( const Array & );              // copy constructor
00016    ~Array();                            // destructor
00017    int getSize() const;                 // return size
00018    const Array &operator=( const Array & ); // assign arrays
00019    bool operator==( const Array & ) const;  // compare equal
00020 
00021    // Determine if two arrays are not equal and
00022    // return true, otherwise return false (uses operator==).
00023    bool operator!=( const Array &right ) const  
00024       { return ! ( *this == right ); }
00025    
00026    int &operator[]( int );              // subscript operator
00027    const int &operator[]( int ) const;  // subscript operator
00028    static int getArrayCount();          // Return count of 
00029                                         // arrays instantiated.
00030 private:
00031    int size; // size of the array
00032    int *ptr; // pointer to first element of array
00033    static int arrayCount;  // # of Arrays instantiated
00034 };
00035 
00036 #endif
00037 

Generated on Sun Oct 14 18:46:17 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001