mvalngbase.h

Go to the documentation of this file.
00001 //
00002 //******************************************************************************
00003 //                    MVALNGBASE.H
00004 //******************************************************************************
00005 //
00006 //
00007 //********************************************************************************
00008 //
00009 //            Chris Anderson (C) UCLA 1995
00010 //
00011 //
00012 //********************************************************************************
00013 //
00014 #ifndef __CAMMVALONGBASE__
00015 #define __CAMMVALONGBASE__
00016 
00017 #include <iostream.h>
00018 #include "mvaimpexp.h"
00019 
00020 class __IMPEXP__ MVAlongBase
00021 {
00022 
00023 public :
00024 
00025     long*  dataPointer;
00026     long  size;
00027 
00028 public :
00029 
00030     MVAlongBase();
00031     MVAlongBase( const MVAlongBase& A);
00032     MVAlongBase(long inSize);
00033     MVAlongBase(long* data, long inSize);
00034 //
00035 //  Destructor 
00036 //
00037     virtual ~MVAlongBase();
00038 //
00039 //  Output 
00040 //
00041     __IMPEXP__ friend ostream& operator <<(ostream& out_stream, const MVAlongBase& A);
00042 //
00043 //  Input
00044 //
00045     __IMPEXP__ friend istream&  operator >>(istream& in_stream, MVAlongBase& A);
00046 //
00047 //  Assignment 
00048 //
00049     MVAlongBase& operator = ( const MVAlongBase& A);
00050 //
00051 //  Initialization
00052 //
00053     void  initialize();
00054     void  initialize(const MVAlongBase& A);
00055     void  initialize(long inSize);
00056     void  initialize(long* data, long inSize);
00057 //
00058 //  Resizing
00059 //
00060     virtual void  resizeTo(long n);
00061 //
00062 //  Access
00063 //
00064     long  getSize() const {return size;};
00065     long*  getDataPointer() {return dataPointer;};
00066     const long*  getDataPointer() const{return dataPointer;};
00067     inline long  &  operator[](long Index)
00068 {
00069 #ifndef NOBOUNDS
00070    if (( Index < 0  ) || ( Index >= size))
00071    {MVAlongBase::indexError(Index);}
00072 #endif
00073    return(*(dataPointer + Index));
00074 };
00075     inline const long &  operator[] (long Index ) const
00076 {
00077 #ifndef NOBOUNDS
00078    if (( Index < 0  ) || ( Index >= size))
00079    {MVAlongBase::indexError(Index);}
00080 #endif
00081    return(*(dataPointer + Index));
00082 };
00083     void  copyToArray(long* A) const;
00084 //
00085 //  Logical Operands
00086 //
00087     int  operator == (const MVAlongBase& A) const;
00088     int  operator != (const MVAlongBase& A) const;
00089 
00090 protected :
00091 
00092 //
00093 //  Error Handling
00094 //
00095     static void  indexError(long Index);
00096     static void  sizeError(long Lsize, long Rsize);
00097     static void  reSizeError(long size);
00098     static void  inputError(long ArraySize, long RequiredSize);
00099 //
00100 //  Input Utility
00101 //
00102     static void  inputLong(istream& in, MVAlongBase& A);
00103 //
00104 //  Memory Allocation
00105 //
00106     virtual long*  newLong(long size);
00107     virtual void  deleteLong();
00108 
00109 };
00110 
00111 #endif
00112 //
00113 //********************************************************************************
00114 //                     Header File End 
00115 //********************************************************************************
00116 //
00117 
00118   

Generated on Wed Aug 6 12:58:49 2003 for Open-Sessame Framework by doxygen1.3