Ignore:
Timestamp:
Aug 31, 2000, 5:00:13 AM (25 years ago)
Author:
bird
Message:

Fixes and enhancements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/common/kList.h

    r3237 r4129  
    1 /* $Id: kList.h,v 1.2 2000-03-25 23:17:47 bird Exp $ */
     1/* $Id: kList.h,v 1.3 2000-08-31 03:00:13 bird Exp $ */
    22/*
    33 * Simple list and sorted list template class.
    4  * Note: simple list is not implemented yet, as it is not yet needed.
    54 *
    65 * Copyright (c) 1999 knut st. osmundsen
     
    98#ifndef _lkList_h_
    109#define _lkList_h_
     10
    1111
    1212    /**
     
    4040                return pNext;
    4141            }
     42    };
    4243
    43             #if 0
    44                 /* !MUST IMPLEMENT! */
    45                 BOOL operator==(const k... &entry) const;
    46                 BOOL operator!=(const k... &entry) const;
    47                 BOOL operator< (const k... &entry) const;
    48                 BOOL operator<=(const k... &entry) const;
    49                 BOOL operator> (const k... &entry) const;
    50                 BOOL operator>=(const k... &entry) const;
     44
     45
     46    /**
     47     * List template. Not Implemented yet.
     48     * @author      knut st. osmundsen
     49     */
     50    template <class kEntry>
     51    class kList
     52    {
     53        private:
     54            kEntry        *pFirst;
     55            kEntry        *pLast;
     56            unsigned long  cEntries;
     57
     58        public:
     59            kList(void);
     60            ~kList(void);
     61
     62            void            destroy(void);
     63            void            insert(kEntry *pEntry);
     64            kEntry *        getFirst(void) const;
     65            kEntry *        getLast(void) const;
     66            unsigned long   getCount(void) const;
     67    };
     68
     69
     70    /**
     71     * List entry parent function.
     72     * @purpose     Serve as a base class for list sorted entries.
     73     * @author      knut st. osmundsen
     74     */
     75    class kSortedListEntry : public kListEntry
     76    {
     77        public:
     78            #if 0 //MUST BE IMPLEMENTED!
     79            virtual BOOL operator==(const k..Entry &entry) const = 0;
     80            virtual BOOL operator!=(const k..Entry &entry) const = 0;
     81            virtual BOOL operator< (const k..Entry &entry) const = 0;
     82            virtual BOOL operator<=(const k..Entry &entry) const = 0;
     83            virtual BOOL operator> (const k..Entry &entry) const = 0;
     84            virtual BOOL operator>=(const k..Entry &entry) const = 0;
    5185            #endif
    5286    };
     
    78112
    79113
    80     /**
    81      * List template. Not Implemented yet.
    82      * @author      knut st. osmundsen
    83      */
    84     template <class kEntry>
    85     class kList
    86     {
    87         private:
    88             kEntry        *pFirst;
    89             kEntry        *pLast;
    90             unsigned long  cEntries;
    91 
    92         public:
    93             kList(void);
    94             ~kList(void);
    95 
    96             void            destroy(void);
    97             void            insert(kEntry *pEntry);
    98             kEntry *        getFirst(void) const;
    99             kEntry *        getLast(void) const;
    100             unsigned long   getCount(void) const;
    101     };
    102 
    103114#endif
    104115
Note: See TracChangeset for help on using the changeset viewer.