list.h

00001 
00010 template <typename T>
00011 class List {
00012 
00013   public:
00014     List();
00015     List( const List<T> & ) throw ( bad_alloc );
00016     ~List();
00017     unsigned size() const;
00018     void clear();
00019     bool empty() const;
00020     void push_back(const T &) throw ( bad_alloc );
00021     void push_front(const T &) throw ( bad_alloc );
00022     T pop_front() throw ( ListEmpty );
00023     T pop_back() throw ( ListEmpty );
00024     T &getFront() const throw ( ListEmpty );
00025     T &getCurrent() const throw ( ListEmpty );
00026     T &getBack() const throw ( ListEmpty );
00027     void insertBeforeCurrent(const T &) throw ( ListEmpty, bad_alloc );
00028     void insertAfterCurrent(const T &) throw ( ListEmpty, bad_alloc );
00029     T removeCurrent() throw ( ListEmpty );
00030     void setToFront() throw ( ListEmpty );
00031     void setToBack() throw ( ListEmpty );
00032     void moveForward() throw ( ListEmpty );
00033     void moveBackward() throw ( ListEmpty );
00034     bool find( const T & ) throw ( ListEmpty );
00035     bool atFront() const throw ( ListEmpty );
00036     bool atBack() const throw ( ListEmpty );
00037     const List<T> &operator=( const List<T> & ) throw ( bad_alloc);
00038 
00039   private:
00040     Node<T> *head, *tail;
00041     Node<T> *current;
00042     unsigned sz;
00043 
00044 }; // List class
00045 
00046 /*------------------------------------------------------------------------*/
00047 
00052 template <typename T>
00053 List<T>::List()
00054 {
00055 } // List<T>::List
00056 
00057 /*------------------------------------------------------------------------*/
00058 
00065 template <typename T>
00066 List<T>::List( const List<T> &l ) throw ( bad_alloc )
00067 {
00068 } // List<T>::List
00069 
00070 /*------------------------------------------------------------------------*/
00071 
00076 template <typename T>
00077 List<T>::~List()
00078 {
00079 } // List<T>::~List
00080 
00081 /*------------------------------------------------------------------------*/
00082 
00089 template <typename T>
00090 unsigned List<T>::size() const
00091 {
00092 } // List<T>::size
00093 
00094 /*------------------------------------------------------------------------*/
00095 
00100 template <typename T>
00101 void List<T>::clear()
00102 {
00103 } // List<T>::clear
00104 
00105 /*------------------------------------------------------------------------*/
00106 
00113 template <typename T>
00114 bool List<T>::empty() const
00115 {
00116 } // List<T>::empty
00117 
00118 /*------------------------------------------------------------------------*/
00119 
00128 template <typename T>
00129 void List<T>::push_back(const T &object) throw ( bad_alloc )
00130 {
00131 } // List<T>::push_back
00132 
00133 /*------------------------------------------------------------------------*/
00134 
00143 template <typename T>
00144 void List<T>::push_front(const T &object) throw ( bad_alloc )
00145 {
00146 } // List<T>::push_front
00147 
00148 /*------------------------------------------------------------------------*/
00149 
00159 template <typename T>
00160 T List<T>::pop_front() throw ( ListEmpty )
00161 {
00162 } // List<T>::pop_front
00163 
00164 /*------------------------------------------------------------------------*/
00165 
00175 template <typename T>
00176 T List<T>::pop_back() throw ( ListEmpty )
00177 {
00178 } // List<T>::pop_back
00179 
00180 /*------------------------------------------------------------------------*/
00181 
00190 template <typename T>
00191 T &List<T>::getFront() const throw ( ListEmpty )
00192 {
00193 } // List<T>::getFront
00194 
00195 /*------------------------------------------------------------------------*/
00196 
00204 template <typename T>
00205 T &List<T>::getCurrent() const throw ( ListEmpty )
00206 {
00207 } // List<T>::getCurrent
00208 
00209 /*------------------------------------------------------------------------*/
00210 
00219 template <typename T>
00220 T &List<T>::getBack() const throw ( ListEmpty )
00221 {
00222 } // List<T>::getBack
00223 
00224 /*------------------------------------------------------------------------*/
00225 
00235 template <typename T>
00236 void List<T>::insertBeforeCurrent(const T &object) throw (ListEmpty, bad_alloc)
00237 {
00238 } // List<T>::insertBeforeCurrent
00239 
00240 /*------------------------------------------------------------------------*/
00241 
00251 template <typename T>
00252 void List<T>::insertAfterCurrent(const T &object) throw (ListEmpty, bad_alloc)
00253 {
00254 } // List<T>::insertAfterCurrent
00255 
00256 /*------------------------------------------------------------------------*/
00257 
00267 template <typename T>
00268 T List<T>::removeCurrent() throw ( ListEmpty )
00269 {
00270 } // List<T>::removeCurrent
00271 
00272 /*------------------------------------------------------------------------*/
00273 
00280 template <typename T>
00281 void List<T>::setToFront() throw ( ListEmpty )
00282 {
00283 } // List<T>::setToFront
00284 
00285 /*------------------------------------------------------------------------*/
00286 
00293 template <typename T>
00294 void List<T>::setToBack() throw ( ListEmpty )
00295 {
00296 } // List<T>::setToBack
00297 
00298 /*------------------------------------------------------------------------*/
00299 
00307 template <typename T>
00308 void List<T>::moveForward() throw ( ListEmpty )
00309 {
00310 } // List<T>::moveForward
00311 
00312 /*------------------------------------------------------------------------*/
00313 
00321 template <typename T>
00322 void List<T>::moveBackward() throw ( ListEmpty )
00323 {
00324 } // List<T>::moveBackward
00325 
00326 /*------------------------------------------------------------------------*/
00327 
00338 template <typename T>
00339 bool List<T>::find( const T &object ) throw ( ListEmpty )
00340 {
00341 } // List<T>::find
00342 
00343 /*------------------------------------------------------------------------*/
00344 
00353 template <typename T>
00354 bool List<T>::atFront() const throw ( ListEmpty )
00355 {
00356 } // List<T>::atFront
00357 
00358 /*------------------------------------------------------------------------*/
00359 
00368 template <typename T>
00369 bool List<T>::atBack() const throw ( ListEmpty )
00370 {
00371 } // List<T>::atBack
00372 
00373 /*------------------------------------------------------------------------*/
00374 
00383 template <typename T>
00384 const List<T> &List<T>::operator=( const List<T> &list )
00385     throw ( bad_alloc )
00386 {
00387 } // List<T>::operator=
00388 
00389 #endif // LIST_H

Generated on Wed Feb 27 10:08:54 2008 by  doxygen 1.5.1