iocpthreadpoolqueue.h
来自「MiniCA V2.0版本源码。《小型CA系统V2.1含源码》发表以来」· C头文件 代码 · 共 65 行
H
65 行
/*
Module : IOCPThreadPoolQueue.h
Purpose: Interface for an MFC class which implements a queue class for CThreadPoolServer using an SDK IO Completion port
Created: PJN / 18-08-2002
Copyright (c) 2002 - 2005 by PJ Naughter. (Web: www.naughter.com, Email: pjna@naughter.com)
All rights reserved.
Copyright / Usage Details:
You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise)
when your product is released in binary form. You are allowed to modify the source code in any way you want
except you cannot modify the copyright details at the top of each module. If you want to distribute source
code with your application, then you are only allowed to distribute versions released by the author. This is
to maintain a single distribution point for the source code.
*/
///////////////////// Defines /////////////////////////////////////////////////
#ifndef __IOCPTHREADPOOLQUEUE_H__
#define __IOCPTHREADPOOLQUEUE_H__
#ifndef THRDPOOL_EXT_CLASS
#define THRDPOOL_EXT_CLASS
#endif
///////////////////// Includes ////////////////////////////////////////////////
#include "ThrdPool.h"
///////////////////// Classes /////////////////////////////////////////////////
//Class which implements a queue for CThreadPoolServer using an IO Completion Port
class THRDPOOL_EXT_CLASS CIOCPThreadPoolQueue : public CThreadPoolQueue
{
public:
//Constructors / Destructors
CIOCPThreadPoolQueue();
virtual ~CIOCPThreadPoolQueue();
//Methods
virtual BOOL Create(DWORD dwMaxQSize);
virtual BOOL Close();
virtual BOOL PostRequest(const CThreadPoolRequest& request, DWORD dwMilliseconds);
virtual BOOL PostRequestWithoutLimitCheck(const CThreadPoolRequest& request) { return PostRequest(request, 0); };
virtual BOOL GetRequest(CThreadPoolRequest& request, int nThreadIndexForDirectedRequest, DWORD dwMilliseconds = INFINITE);
virtual BOOL IsCreated() const;
virtual BOOL SupportsDirectedRequests() const { return FALSE; };
protected:
DECLARE_DYNCREATE(CIOCPThreadPoolQueue)
//Member variables
HANDLE m_hIOCP; //Handle to the SDK IOCP
};
#endif //__IOCPTHREADPOOLQUEUE_H__
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?