00001 #ifndef ARRAY_TEMPLATE_CLASS_HEADER_INCLUDED 00002 #define ARRAY_TEMPLATE_CLASS_HEADER_INCLUDED 00003 00004 template <typename ElementType> 00005 class Array { 00006 ElementType *arr; 00007 long allocated, they_think; 00008 long min_idx; 00009 00010 public: 00011 Array(long size = 10, long start = 0); 00012 Array(const Array & array); 00013 ~Array(); 00014 00015 Array & operator = (const Array & array); 00016 00017 long get_size(void) const; 00018 long get_end(void) const; 00019 long get_start(void) const; 00020 00021 void resize(long size); 00022 void realign(long start); 00023 00024 ElementType & operator [] (long index); 00025 const ElementType & operator [] (long index) const; 00026 }; 00027 00028 #ifdef TEMPLATE_CLASSES_WONT_COMPILE 00029 #include "array.def" 00030 #endif 00031 00032 #endif