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

CTBrawBuffer.hxx

Go to the documentation of this file.
00001 #ifndef included_CTBrawBuffer
00002 #define included_CTBrawBuffer 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 "CTBgrab.hxx"
00017 
00018 template <class T>
00019 class CTBrawBuffer {
00020 
00021   public: 
00022                     CTBrawBuffer();
00023     explicit        CTBrawBuffer(CTBint i_capacity);
00024                     CTBrawBuffer(CTBrawBuffer<T>& rhs, bool b_grab);
00025 
00026                     ~CTBrawBuffer();
00027 
00028     void            Construct(CTBint i_ind);
00029     void            Construct(T* p_ele);
00030 
00031     void            ConstructRange(CTBint i_beg, CTBint i_size);
00032 
00033     void            Construct(CTBint i_ind, const T& value);
00034     void            Construct(T* p_ele, const T& value);
00035 
00036     void            ConstructRange(CTBint i_beg, CTBint i_size,
00037                                    const T& value);
00038     void            ConstructRange(CTBint i_beg, CTBint i_size,
00039                                    const T rhs[]);
00040 
00041     void            Destruct(CTBint i_ind);
00042     void            Destruct(T* p_ele);
00043 
00044     void            DestructRange(CTBint i_beg, CTBint i_size);
00045 
00046     void            GrabConstruct(CTBint i_ind, T& value);
00047     void            GrabConstructRange(CTBint i_beg, CTBint i_size,T rhs[]);
00048 
00049     void            GrabDestruct(CTBint i_ind, T& obj);
00050 
00051     CTBint          Capacity() const;
00052     void            Resize(CTBint i_capacity);
00053 
00054     void            Grab(CTBrawBuffer<T>& rhs);
00055 
00056     bool            Empty() const;
00057 
00058     void            ShiftRight(CTBint i_beg, CTBint i_end);
00059     void            ShiftLeft(CTBint i_beg, CTBint i_end);
00060 
00061     void            Copy(CTBint i_beg, CTBint i_size, const T& rhs);
00062     void            Copy(CTBint i_beg, CTBint i_size, const T rhs[]);
00063 
00064     void            Dump(int i_indent=0, ostream& os=cout,
00065                          const char* p_text=0) const;
00066 
00067     T*              operator+(CTBint i_ind);
00068     const T*        operator+(CTBint i_ind) const;
00069 
00070     T&              operator[](CTBint i_ind);
00071     const T&        operator[](CTBint i_ind) const;
00072 
00073     bool            operator!() const;
00074 
00075                     operator T*();
00076                     operator const T*() const;
00077 
00078   private:
00079 
00080     void            DeleteBuffer();
00081     void            CreateBuffer(CTBint i_capacity);
00082 
00083                     CTBrawBuffer(           // copy constructor DUMMY
00084                       const CTBrawBuffer<T>& rhs);
00085     CTBrawBuffer<T>&  operator=(            // assigment DUMMY
00086                       const CTBrawBuffer<T>& rhs);
00087 
00088   private: 
00089     T*              mp_data;                
00090     CTBint          mi_capacity;            
00091 };
00092 
00093 template <class T>
00094 class CTBgrab<CTBrawBuffer<T> > : public CTBgrabable<CTBrawBuffer<T> > {};
00095 
00096 //
00097 // the implementation is fully inlined and always included here
00098 //
00099 #include "CTBrawBuffer.icc"
00100 
00101 #endif

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