midblary.h

Go to the documentation of this file.
00001 /**
00002  * \file midblary.h <mi32/midblary.h>
00003  * \brief Definitions for MIDOUBLEARRAY class
00004  *
00005  * \if NODOC
00006  * $Id: midblary.h_v 1.4 2003/09/15 13:49:56 fileserver!dwilliss Exp $
00007  *
00008  * $Log: midblary.h_v $
00009  * Revision 1.4  2003/09/15 13:49:56  fileserver!dwilliss
00010  * Doxygen
00011  *
00012  * Revision 1.3  2002/05/17 19:47:23  dwilliss
00013  * Export even on the Mac using their non-standard way.
00014  *
00015  * Revision 1.2  2002/05/14 20:31:32  dwilliss
00016  * Added a newline to the end of the file to make gcc shut up about it
00017  *
00018  * Revision 1.1  2001/05/16 17:13:34  scowan
00019  * Initial revision
00020  *
00021  *
00022  * \endif
00023 **/
00024 
00025 #ifndef  INC_MI32_MIDBLARY_H
00026 #define  INC_MI32_MIDBLARY_H
00027 
00028 #ifndef  INC_MI32_STDDEFNS_H
00029    #include <mi32/stddefns.h>
00030 #endif
00031 
00032 #ifdef MIODLL
00033    #define CLASSLIBEXPORT MI_DLLCLASSEXPORT
00034    #ifdef MAC_NATIVE
00035    #pragma export on
00036    #endif
00037 #else
00038    #define CLASSLIBEXPORT MI_DLLCLASSIMPORT
00039 #endif
00040 
00041 //!   MIDOUBLEARRAY class exists to solve an issue with some OS's that cannot correctly align a buffer of double's on a double boundary.
00042 //! Not aligning on a double boundary can cause a speed penalty on some platforms.  This class creates a buffer that is forced to be 
00043 //! double aligned.  This is exported from MISYSTEM.DLL and must not be inherited from.  Currently DOUBLE_ARRAY<> and POLYLINE classes 
00044 //! use this class as their foundation.  Thise classes should meet most of your needs.
00045 
00046 class CLASSLIBEXPORT MIDOUBLEARRAY {
00047 public:
00048 
00049    // CONSTRUCTORS / DESTRUCTOR
00050 
00051    //! Default Constructor
00052    MIDOUBLEARRAY (
00053       );
00054 
00055    //! Copy Constructor
00056    MIDOUBLEARRAY (
00057       const MIDOUBLEARRAY& rhs
00058       );
00059 
00060    //! Destructor
00061    ~MIDOUBLEARRAY (
00062       );
00063       
00064    // OPERATORS
00065 
00066    //! Assignment.
00067    MIDOUBLEARRAY& operator= (
00068       const MIDOUBLEARRAY& rhs
00069       );
00070       
00071    // METHODS
00072    
00073    //! Attach a MIDOUBLEARRAY to this one and clear out 'rhs'
00074    void Attach (
00075       MIDOUBLEARRAY& rhs
00076       );
00077 
00078    //! Free MIDOUBLEARRAY buffer
00079    void Free (
00080       );
00081    
00082    //! Get pointer to internal buffer.
00083    //! DO NOT REALLOCATE OR FREE THIS POINTER, YOU WILL CRASH
00084    //!
00085    //! @return Pointer to correctly aligned double array buffer
00086    double* GetPointer (
00087       );
00088       
00089    //! Get reserved size of buffer in doubles
00090    //!
00091    //! @return Size of reserved buffer in doubles
00092    int GetNumReserved (
00093       ) const;
00094 
00095    //! Reserve number of doubles in the array      
00096    ERRVALUE Reserve (
00097       INT32 NewSize,
00098       bool keepold = false
00099       );
00100       
00101    //! Reserve number of doubles in the array, throws exception if error
00102    void ReserveExc (
00103       INT32 NewSize,
00104       bool keepold = false
00105       );
00106 
00107    //! Swap buffers between 'this' and 'rhs'    
00108    void Swap (
00109       MIDOUBLEARRAY& rhs
00110       );
00111       
00112 private:
00113    #ifndef GENERATING_DOXYGEN_OUTPUT
00114 
00115    double *m_items;                    //!< The accessed array
00116    void *m_buffer;                     //!< The allocated array
00117    int m_BufferSize;                   //!< Size of buffer in bytes
00118    
00119    // METHODS  
00120    void Allocate (
00121       int NewSize
00122       );
00123 
00124    ERRVALUE AllocateWithErr (
00125       int NewSize
00126       );
00127    #endif // GENERATING_DOXYGEN_OUTPUT
00128 
00129 };
00130 
00131 #if defined(MIODLL) && defined(MAC_NATIVE)
00132    #pragma export reset
00133 #endif
00134 
00135 #endif      //!< INC_MI32_MIDBLARY_H
00136 

Generated on Tue Dec 14 13:18:28 2004 for TNTsdk by  doxygen 1.3.8-20040913