TAPs 0.7.7.3
TAPsD1Array.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsD1Array.hpp
00003 
00004 Simple Data Structure (hpp file).
00005 
00006 SUKITTI PUNAK   (08/25/2008)
00007 ******************************************************************************/
00008 #ifndef TAPs_D1_ARRAY_HPP
00009 #define TAPs_D1_ARRAY_HPP
00010 
00016 #include "../Core/TAPsStdLib.hpp"
00017 
00018 BEGIN_NAMESPACE_TAPs__DS
00019 //=============================================================================
00020 template <typename T>
00021 class D1Array {
00022 //=============================================================================
00023 public:
00024     // Member Functions -------------------------------------------------------
00026     friend std::ostream & operator<< ( std::ostream &output, D1Array<T> const &obj )
00027     {
00028         output << obj.StrInfo();
00029         return output;
00030     }
00031 
00033     D1Array ( unsigned int size = 1, unsigned int stride = 1 );
00034 
00036     ~D1Array ();
00037 
00039     virtual std::string StrInfo () const;
00040 
00042     virtual std::string StrArrayData () const;
00043 
00045     inline D1Array<T> & operator= ( D1Array<T> const & obj );
00046 
00048     T * GetAddressOfDataNumber ( unsigned int i )   { return m_atData + i*m_uiStride; }
00049 
00051     bool Resize ( unsigned int size, unsigned int stride );
00052 
00054     unsigned int GetSize () const   { return m_uiSize; }
00055 
00057     unsigned int GetStride () const { return m_uiStride; }
00058 
00060     //inline bool operator== ( D1Array<T> const &v ) const;
00061     //inline bool operator<  ( D1Array<T> const &v ) const;
00062     //inline bool operator>= ( D1Array<T> const &v ) const;
00063     //inline bool operator>  ( D1Array<T> const &v ) const;
00064     //inline bool operator<= ( D1Array<T> const &v ) const;
00065 
00066     //-------------------------------------------------------------------------
00073     //static inline int Dominate ( D1Array<T> const &a, D1Array<T> const &b );
00074 
00075     // Data Members -----------------------------------------------------------
00076 //=============================================================================
00077 protected:
00078     // Member Functions -------------------------------------------------------
00079     // Data Members -----------------------------------------------------------
00080     T   *           m_atData;       
00081     unsigned int    m_uiSize;       
00082     unsigned int    m_uiStride;     
00083 //=============================================================================
00084 private:
00085     // Member Functions -------------------------------------------------------
00086     // Data Members -----------------------------------------------------------
00087 //=============================================================================
00088 }; // END CLASS D1Array
00089 //=============================================================================
00090 //-----------------------------------------------------------------------------
00092 typedef D1Array<int>    D1Arrayi;
00093 typedef D1Array<float>  D1Arrayf;
00094 typedef D1Array<double> D1Arrayd;
00095 //=============================================================================
00096 END_NAMESPACE_TAPs__DS
00097 //-----------------------------------------------------------------------------
00098 // Include definition if TAPs_USE_EXPORT is not defined
00099 
00100 // If the class is template, use this
00101 //#if !defined( TAPs_USE_EXPORT )
00102     #include "TAPsD1Array.cpp"
00103 //#endif
00104 
00105 // If the class is NOT template, use this
00106 //#if !defined( TAPs_USE_EXPORT )
00107 //  #include "TAPsSimpleDS.cpp"
00108 //#endif
00109 
00110 //-----------------------------------------------------------------------------
00111 #endif
00112 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00113 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines