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

CTBbasicList.hxx

Go to the documentation of this file.
00001 #ifndef _CTBbasicList_HXX
00002 #define _CTBbasicList_HXX 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 template <class TC>
00017 class CTBbasicListHead;
00018 
00019 template <class TC>
00020 class CTBbasicListLink {
00021 
00022   public: 
00023 
00024                     CTBbasicListLink();
00025                     ~CTBbasicListLink();
00026 
00027     TC*             Prev() const;
00028     TC*             Next() const;
00029 
00030     void            InsertHead(TC* p_this,
00031                                CTBbasicListLink<TC> TC::* o_link,
00032                                CTBbasicListHead<TC>& head);
00033     void            InsertTail(TC* p_this,
00034                                CTBbasicListLink<TC> TC::* o_link,
00035                                CTBbasicListHead<TC>& head);
00036 
00037     void            InsertBefore(TC* p_this,
00038                                  CTBbasicListLink<TC> TC::* o_link,
00039                                  CTBbasicListHead<TC>& head,
00040                                  TC& elem);
00041     void            InsertAfter(TC* p_this,
00042                                 CTBbasicListLink<TC> TC::* o_link,
00043                                 CTBbasicListHead<TC>& head,
00044                                 TC& elem);
00045 
00046     void            Remove(CTBbasicListLink<TC> TC::* o_link,
00047                            CTBbasicListHead<TC>& head);
00048 
00049   private:
00050 
00051                     CTBbasicListLink(       // copy constructor DUMMY
00052                       const CTBbasicListLink<TC>& rhs);
00053     CTBbasicListLink<TC>& operator=(        // assignment operator DUMMY  
00054                       const CTBbasicListLink<TC>& rhs);
00055 
00056   private:
00057 
00058     TC* mp_prev;
00059     TC* mp_next;  
00060 };
00061 
00062 //------------------------------------------+-----------------------------------
00063 template <class TC>
00064 class CTBbasicListHead {
00065 
00066   friend class CTBbasicListLink<TC>;
00067 
00068   public: 
00069 
00070                     CTBbasicListHead();
00071                     ~CTBbasicListHead();
00072 
00073     TC*             First() const;
00074     TC*             Last() const;
00075 
00076     bool            operator! () const;
00077 
00078                     operator bool() const;
00079 
00080   private:
00081 
00082                     CTBbasicListHead(       // copy constructor DUMMY
00083                       const CTBbasicListHead<TC>& rhs);
00084     CTBbasicListHead<TC>& operator=(        // assignment operator DUMMY  
00085                       const CTBbasicListHead<TC>& rhs);
00086 
00087   private:
00088 
00089     TC* mp_first;
00090     TC* mp_last;  
00091 };
00092 
00093 // implementation is all inline !!
00094 #include "CTBbasicList.icc"
00095 
00096 #endif
00097 
00098 
00099 
00100 
00101 
00102 

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