#pragma once

#include "constdef.h"

class QueueStrManager
{
	typedef DWORD (WINAPI *PFCALLBACK)(const char* lparam);
private:
	char* m_chr;
	int m_couter;
	int m_length;
	int m_max_couter;
	int m_max_length;
	PFCALLBACK m_pfunc;
	CRITICAL_SECTION m_csQueueList;
public:
	QueueStrManager(void);
	QueueStrManager(int c, int l, PFCALLBACK func ): m_max_couter(c), m_max_length(l), m_couter(0), m_length(0), m_pfunc(func)
	{
		m_chr = new char[m_max_length];
		InitializeCriticalSectionAndSpinCount(&m_csQueueList, MAXCRITICALSECTIONSPINCOUNT);
	};
	~QueueStrManager(void);
	void AddString(const char * chr);
	void Execute();
};

