Main Page | Namespace List | Class List | Directories | File List | Class Members | File Members

TArray.h

Go to the documentation of this file.
00001 // TArray.h: interface for the CTArray class.
00002 //
00004 
00005 #if !defined(AFX_TARRAY_H__5C18C5F4_170D_4D56_BFDA_B5173B41596D__INCLUDED_)
00006 #define AFX_TARRAY_H__5C18C5F4_170D_4D56_BFDA_B5173B41596D__INCLUDED_
00007 
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011 
00012 
00013 
00014 template <class TYPE> class CTArray  
00015 {
00016         
00017 private:
00018         TYPE* m_memory;      
00019         bool  m_isAllocated; 
00020         long  m_dimension;   
00021         long  m_activeIndex; 
00022      
00023 public:
00024         CTArray();                                                     
00025         CTArray( long dimension );                                     
00026         CTArray( TYPE* memory, long dimension, long activeIndex = 0 ); 
00027         CTArray( const CTArray< TYPE >& array );                       
00028         ~CTArray();                                                    
00029 
00030 public:
00031         void Construction( long dimension );                                     
00032         void Construction( TYPE* memory, long dimension, long activeIndex = 0 ); 
00033         void Construction( const CTArray< TYPE >& array );                      
00034         void Destruction();                                                      
00035 
00036         void ImportFrom( const void* source );    
00037         void ExportTo( void* destination ) const; 
00038         
00039         TYPE& operator[]( long index ) const;                         
00040         TYPE& operator*() const;                                      
00041 
00042         CTArray< TYPE >& operator= ( const CTArray< TYPE >& array );  
00043         CTArray< TYPE >& operator&=( const CTArray< TYPE> & array );  
00044 
00045         //bool operator==( const CTArray< TYPE >& array ) const;        
00046         //bool operator!=( const CTArray< TYPE >& array ) const;        
00047         //bool operator>=( const CTArray< TYPE >& array ) const;        
00048         //bool operator> ( const CTArray< TYPE >& array ) const;        
00049         //bool operator<=( const CTArray< TYPE >& array ) const;        
00050         //bool operator< ( const CTArray< TYPE >& array ) const;        
00051 
00052         //CTArray< TYPE >& operator+ ( long step ) const;               
00053         //CTArray< TYPE >& operator+=( long step );                     
00054 
00055         //CTArray< TYPE >& operator- ( long step ) const;               
00056         //CTArray< TYPE >& operator-=( long step );                     
00057 
00058         //CTArray< TYPE >& operator++();                                
00059         //CTArray< TYPE >& operator++( int );                           
00060 
00061         //CTArray< TYPE >& operator--();                                
00062         //CTArray< TYPE >& operator--( int );                           
00063 
00064         //long operator-( const CTArray< TYPE >& array ) const;         
00065         
00066         bool Is_index_valid( long index ) const;                        
00067 
00068         
00069 public:
00070         bool IsNull() const;         
00071         bool IsNotNull() const;      
00072         long GetDimension() const;   
00073         long GetSizeInBytes() const; 
00074 
00075         long GetLowerBound() const; 
00076         long GetUpperBound() const;  
00077         
00078         TYPE * GetMemoryPointer() const;  
00079 
00080 private:
00081         void Verification( char* message ) const; 
00082 
00083 };
00084 
00085 #ifndef _TARRAY_CPP_BY_MAY_HUANG_28_SEPT_2005_
00086 #define _TARRAY_CPP_BY_MAY_HUANG_28_SEPT_2005_
00087 #include "TArray.cpp"
00088 #endif
00089 
00090 #endif // !defined(AFX_TARRAY_H__5C18C5F4_170D_4D56_BFDA_B5173B41596D__INCLUDED_)

Generated on Tue Aug 29 11:42:40 2006 for PageLayoutDOCLIB by  doxygen 1.4.2