Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBvectorDsc.hxx

Go to the documentation of this file.
00001 #ifndef included_CTBvectorDsc
00002 #define included_CTBvectorDsc 1
00003 
00008 /*----------------------------------------------------------------------------*/
00009 /* C Tool Box: Designed and implemented by:                                   */
00010 /*    Walter F.J. Mueller   Gesellschaft fuer Schwerionenforschung (GSI)      */
00011 /*                          Planckstrasse 1, D-64291 Darmstadt, Germany       */
00012 /*                  Email:  W.F.J.Mueller@gsi.de                              */
00013 /*                  WWW:    http://www-kp3.gsi.de/www/kp3/people/mueller.html */
00014 /*------------------------------------------+---------------------------------*/
00015 
00016 #include "CTBrange.hxx"
00017 
00018 template <class T>
00019 class CTBvectorCDsc {
00020   public: 
00021 
00022                     CTBvectorCDsc();
00023                     CTBvectorCDsc(const T* p_data, CTBint i_size, 
00024                                   CTBint i_stride=1);
00025                     CTBvectorCDsc(const T* p_data, CTBrange ran);
00026                     CTBvectorCDsc(const T* p_data, CTBint i_stride,
00027                                   CTBrange ran);
00028 
00029     const T*        Data() const;
00030     CTBint          Size() const;
00031     CTBint          Stride() const;
00032 
00033     void            Dump(int i_indent=0, ostream& os=cout,
00034                          const char* p_text=0) const;
00035 
00036     const T&        operator[](CTBint i_ind) const;
00037     const T&        operator()(CTBint i_ind) const;
00038 
00039     bool            operator!() const;
00040                     operator void* () const;
00041 
00042   protected:
00043 
00044     T*              mp_data;                
00045     CTBint          mi_size;                
00046     CTBint          mi_stride;              
00047 };
00048 
00049 template <class T>
00050 ostream& operator<<(ostream& os, CTBvectorCDsc<T> obj);
00051 
00052 //##############################################################################
00053 
00054 template <class T>
00055 class CTBvectorDsc : public CTBvectorCDsc<T> {
00056   public: 
00057 
00058                     CTBvectorDsc();
00059                     CTBvectorDsc(T* p_data, CTBint i_size, CTBint i_stride=1);
00060                     CTBvectorDsc(T* p_data, CTBrange ran);
00061                     CTBvectorDsc(T* p_data, CTBint i_stride, CTBrange ran);
00062 
00063     T*              Data() const;
00064 
00065     T&              operator[](CTBint i_ind) const;
00066     T&              operator()(CTBint i_ind) const;
00067 
00068     const CTBvectorDsc<T>& operator=(const T& rhs) const;
00069     const CTBvectorDsc<T>& operator=(const CTBvectorDsc<T>& rhs) const;
00070     const CTBvectorDsc<T>& operator=(const CTBvectorCDsc<T>& rhs) const;
00071 };
00072 
00073 // implementation is all inline
00074 #include "CTBvectorDsc.icc"
00075 
00076 #endif

Generated at Fri Oct 24 18:11:30 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001