// @(#)root/cont:$Id$
// Author: Fons Rademakers   14/09/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TSortedList
#define ROOT_TSortedList


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TSortedList                                                          //
//                                                                      //
// A sorted doubly linked list. All sortable classes inheriting from    //
// TObject can be inserted in a TSortedList.                            //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TList
#include "TList.h"
#endif


class TSortedList : public TList {

public:
   TSortedList(Bool_t order = kSortAscending) { fAscending = order; }

   void      Add(TObject *obj);
   void      Add(TObject *obj, Option_t *opt);

   Bool_t    IsSorted() const { return kTRUE; }

   //---- the following methods are overridden to preserve sorting order
   void      AddFirst(TObject *obj) { Add(obj); }
   void      AddFirst(TObject *obj, Option_t *opt) { Add(obj, opt); }
   void      AddLast(TObject *obj) { Add(obj); }
   void      AddLast(TObject *obj, Option_t *opt) { Add(obj, opt); }
   void      AddAt(TObject *obj, Int_t) { Add(obj); }
   void      AddAfter(const TObject *, TObject *obj) { Add(obj); }
   void      AddAfter(TObjLink *, TObject *obj) { Add(obj); }
   void      AddBefore(const TObject *, TObject *obj) { Add(obj); }
   void      AddBefore(TObjLink *, TObject *obj) { Add(obj); }
   void      Sort(Bool_t = kSortAscending) { }

   ClassDef(TSortedList,0)  //A sorted list
};

#endif

 TSortedList.h:1
 TSortedList.h:2
 TSortedList.h:3
 TSortedList.h:4
 TSortedList.h:5
 TSortedList.h:6
 TSortedList.h:7
 TSortedList.h:8
 TSortedList.h:9
 TSortedList.h:10
 TSortedList.h:11
 TSortedList.h:12
 TSortedList.h:13
 TSortedList.h:14
 TSortedList.h:15
 TSortedList.h:16
 TSortedList.h:17
 TSortedList.h:18
 TSortedList.h:19
 TSortedList.h:20
 TSortedList.h:21
 TSortedList.h:22
 TSortedList.h:23
 TSortedList.h:24
 TSortedList.h:25
 TSortedList.h:26
 TSortedList.h:27
 TSortedList.h:28
 TSortedList.h:29
 TSortedList.h:30
 TSortedList.h:31
 TSortedList.h:32
 TSortedList.h:33
 TSortedList.h:34
 TSortedList.h:35
 TSortedList.h:36
 TSortedList.h:37
 TSortedList.h:38
 TSortedList.h:39
 TSortedList.h:40
 TSortedList.h:41
 TSortedList.h:42
 TSortedList.h:43
 TSortedList.h:44
 TSortedList.h:45
 TSortedList.h:46
 TSortedList.h:47
 TSortedList.h:48
 TSortedList.h:49
 TSortedList.h:50
 TSortedList.h:51
 TSortedList.h:52
 TSortedList.h:53
 TSortedList.h:54
 TSortedList.h:55
 TSortedList.h:56