Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/Plugins/Library/ml_transcode/LinkedQueue.h

41 lines
696 B
C
Raw Normal View History

2024-09-24 12:54:57 +00:00
#ifndef _LINKEDQUEUE_H_
#define _LINKEDQUEUE_H_
#include <windows.h>
class LinkedQueue;
class QueueElement;
class QueueElement {
public:
QueueElement * next;
QueueElement * prev;
void * elem;
QueueElement(void * e) { next=NULL; prev=NULL; elem=e; }
};
class LinkedQueue {
protected:
QueueElement * head;
QueueElement * tail;
QueueElement * bm;
int bmpos;
int size;
QueueElement * Find(int pos);
CRITICAL_SECTION cs;
public:
LinkedQueue();
~LinkedQueue();
int GetSize();
void Offer(void * e);
void *Poll();
void *Peek();
void *Get(int pos);
void Set(int pos, void * val);
void *Del(int pos);
void lock();
void unlock();
};
#endif //_LINKEDQUEUE_H_