list.h

来自「Linux 下的线程池的源代码。很好用!」· C头文件 代码 · 共 39 行

H
39
字号
#ifndef _LIST_H_#define _LIST_H_template<class T>class CList {protected:    void**          Data;    int	            m_Len;    int             m_Size;    bool            DuplicatesAllowed;    void                Upgrade (int Upg=20);    static bool         DefaultCompare(void* Sender, void* V1,void* V2);public:    CList(void);    virtual ~CList(void);    int                 Length(void);    virtual int         Add(T* item);    int                 Insert(int index, T* item);    int                 Find(T* item);    void                Del(int index);    bool                Del(T* item);    void                DeleteAll(void);    virtual T*          operator[](int index);    void                CopyOf(CList* L);    void                setDuplicatesOff(bool DisableDuplicates);    T*                  At(int index);/*    void (*OnDelete)(void* Sender, void* V);    void (*DeleteItem)(void* Sender, void* V);    bool (*CompareItems)(void* Sender, void* V1, void* V2);*/};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?