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

CTBmapNode.hxx

Go to the documentation of this file.
00001 #ifndef _CTBmapNode_HXX
00002 #define _CTBmapNode_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 K, class V, class C>
00017 class CTBmapNode : public CTBbtreeNode {
00018   public:
00019 
00020     typedef CTBmap<K,V,C>          Map;
00021     typedef CTBmapNode<K,V,C>      Node;
00022 
00023                     CTBmapNode();
00024                     CTBmapNode(const K& key);
00025                     CTBmapNode(const K& key, const V& value);
00026                     CTBmapNode(const CTBpair<const K,V>& pair);
00027     
00028                     ~CTBmapNode();
00029 
00030     virtual CTBbtreeNode* Clone() const;
00031 
00032     const K&        Key() const;
00033     V&              Value();
00034     const V&        Value() const;
00035 
00036     CTBpair<const K,V>&        Pair();
00037     const CTBpair<const K,V>&  Pair() const;
00038 
00039     CTBmapNode<K,V,C>* Up() const;
00040     CTBmapNode<K,V,C>* Left() const;
00041     CTBmapNode<K,V,C>* Right() const;
00042 
00043     CTBmapNode<K,V,C>* Next() const;
00044     CTBmapNode<K,V,C>* Prev() const;
00045 
00046     CTBmapNode<K,V,C>* Skip(CTBint i_offset) const;
00047 
00048   private:
00049 
00050                     CTBmapNode(const CTBmapNode<K,V,C>& rhs);   // DUMMY
00051     CTBmapNode<K,V,C>& operator=(const CTBmapNode<K,V,C>& rhs); // DUMMY
00052 
00053   private:
00054 
00055     CTBpair<const K,V>  m_pair;             
00056 };
00057 
00058 template <class K, class V, class C>
00059 class CTBclone<CTBmapNode<K,V,C> > : public CTBcloneable<CTBmapNode<K,V,C> > {};
00060 
00061 // Notes:
00062 //  1. The member functions of this class do *not* preserve const-ness !!
00063 //     (e.g. Next() returns a non-const pointer but is a const function...)
00064 //     CTBmapNode is a helper class for CTBmap and the calling functions
00065 //     in CTBmap and the iterators will to the proper, const preserving,
00066 //     handling of all pointers and references.
00067 
00068 #include "CTBmapNode.icc"
00069 
00070 #endif

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