Sophie

Sophie

distrib > Mandriva > cooker > i586 > by-pkgid > 0a6e7da7c1280f0f9d531d0d9573351f > files > 201

d4x-debug-2.5.7.1-7mdv2011.0.i586.rpm

/*	WebDownloader for X-Window
 *	Copyright (C) 1999-2002 Koshelev Maxim
 *	This Program is free but not GPL!!! You can't modify it
 *	without agreement with author. You can't distribute modified
 *	program but you can distribute unmodified program.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */
#ifndef T_QUEUE
#define T_QUEUE

struct tNode{
    tNode *next,*prev;
    tNode();
    virtual void print()=0;
    virtual ~tNode();
};


typedef int (*d4xNodeCmpFunc) (tNode *a,tNode *b);

class tQueue{
    protected:
    int MaxNum,Num;
    tNode *First,*Last,*Curent;
    void free_to_limit();
    public:
    	tQueue();
    	virtual void init(int n);
    	virtual void insert(tNode *what);
    	virtual void insert_before(tNode *what,tNode *where);
    	virtual void del(tNode *what);
    	int count();
    	virtual tNode *last();
    	virtual tNode *first();
    	virtual tNode *next();
    	virtual tNode *prev();
	void sort(d4xNodeCmpFunc cmpfunc);
    	virtual void dispose();
    	virtual void done();
    	virtual ~tQueue();
};

#endif