www.pudn.com > ACEProactor.rar > proactortask.h, change:2006-01-23,size:1167b


// ProactorTask.h: interface for the ProactorTask class. 
// 
////////////////////////////////////////////////////////////////////// 
#include <ace/Task_T.h> 
#include <ace/Thread_Semaphore.h> 
#include <ace/Proactor.h> 
 
#if !defined(AFX_PROACTORTASK_H__0202863B_B4D0_45F4_ABFA_D9974B8D17A3__INCLUDED_) 
#define AFX_PROACTORTASK_H__0202863B_B4D0_45F4_ABFA_D9974B8D17A3__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
typedef enum { DEFAULT = 0, AIOCB, SIG, SUN, CB } ProactorType; 
class ProactorTask : public ACE_Task<ACE_MT_SYNCH> 
{ 
public: 
	ProactorTask(): 
	lock_ (), 
	sem_ ((unsigned int) 0), 
	proactor_(0){} 
	virtual ~ProactorTask() 
	{ 
      (void) this->stop (); 
      (void) this->delete_proactor(); 
	} 
	virtual int svc (void); 
	int start (int num_threads, ProactorType type_proactor, size_t max_op ); 
	int stop (); 
private: 
	int  create_proactor (ProactorType type_proactor, size_t max_op); 
	int  delete_proactor (void); 
	ACE_SYNCH_RECURSIVE_MUTEX lock_; 
	ACE_Thread_Semaphore sem_; 
	ACE_Proactor * proactor_; 
	 
}; 
 
#endif // !defined(AFX_PROACTORTASK_H__0202863B_B4D0_45F4_ABFA_D9974B8D17A3__INCLUDED_)