00001
00002
00003 #ifndef __J2K__ARRAY_HPP__
00004 #define __J2K__ARRAY_HPP__
00005
00006 #include <j2k/Fred/Basic.hpp>
00007 #include <j2k/Fred/Boolean.hpp>
00008 #include <j2k/Fred/StdTypes.hpp>
00009
00010 #define MC_ClassDef_Array( NAME, ELEM ) \
00011 class Array_##NAME \
00012 { \
00013 public: \
00014 Array_##NAME##(); \
00015 Array_##NAME##( UINT sz ); \
00016 Array_##NAME##( const Array_##NAME##& src ); \
00017 virtual ~Array_##NAME##(); \
00018 \
00019 void Reset(); \
00020 void setSize( UINT arraySize ); \
00021 UINT getSize() const; \
00022 \
00023 const Array_##NAME##& operator=( const Array_##NAME##& right ); \
00024 \
00025 BOOL operator==( const Array_##NAME##& right ) const; \
00026 \
00027 \
00028 inline BOOL operator!=( const Array_##NAME##& right ) const { \
00029 return !( *this == right ); \
00030 } \
00031 \
00032 ELEM##& operator[]( UINT ); \
00033 const ELEM##& operator[]( UINT ) const; \
00034 static UINT getArrayCount(); \
00035 \
00036 friend ostream& operator<<( ostream&, const Array_##NAME##& ); \
00037 friend istream& operator>>( istream&, Array_##NAME##& ); \
00038 \
00039 protected: \
00040 UINT size; \
00041 ELEM* ptr; \
00042 static UINT arrayCount; \
00043 };
00044
00045 #endif
00046