//CFTTFile_AsyncQueue - [2020-04-13 11:57:46]
#ifndef _CFTTFILE_ASYNCQUEUE_H_
#define _CFTTFILE_ASYNCQUEUE_H_

#include "CFTTAsyncEvent.h"
#include "CFTTFile.h"
#include "CFTTMemPool_Resizing.h"
#include "FTTSemaphore.h"
#include "FTTThread.h"

/*
002652C8 CFTTFile_AsyncQueue::CFTTFile_AsyncQueue(EFTTThreadPriority)
002653A8 CFTTFile_AsyncQueue::~CFTTFile_AsyncQueue()
002653F8 CFTTFile_AsyncQueue::~CFTTFile_AsyncQueue()
002639B8 CFTTFile_AsyncQueue::Shutdown()
00265344 CFTTFile_AsyncQueue::AsyncThread(void *)
00265406 CFTTFile_AsyncQueue::ProcessOp(CFTTFile_AsyncQueue::TAsyncOp *)
00265594 CFTTFile_AsyncQueue::IsEmpty()
002655A0 CFTTFile_AsyncQueue::ReadAsync(CFTTFile *, void *, long long,long long,void *,CFTTAsyncEvent<TFTTFileAsyncEventData> *)
0026564C CFTTFile_AsyncQueue::WriteAsync(CFTTFile *,void const*,long long,long long,void *,CFTTAsyncEvent<TFTTFileAsyncEventData> *)

0x44
*/

class CFTTFile_AsyncQueue : public CFTTFile_AsyncHandler {
public:
  CFTTFile_AsyncQueue(EFTTThreadPriority ePriority);
  virtual ~CFTTFile_AsyncQueue();

  struct TAsyncOp {
    TFTTFileAsyncEventData TFTTFileAsyncEventData_0;
    CFTTAsyncEvent<TFTTFileAsyncEventData>* pAsyncEvent_28;
    TAsyncOp* pNextOp_2C;
  };

  static void Shutdown();                //002639B8
  static int AsyncThread(void* pobj);    //00265344
  static void ProcessOp(TAsyncOp* pOp);  //00265406
  bool IsEmpty();                        //00265594

  virtual bool ReadAsync(CFTTFile* pCFTTFile,
                         void* pbuf,
                         int64 read_pos,
                         int64 read_len,
                         void* pDat,
                         CFTTAsyncEvent<TFTTFileAsyncEventData>* pEventData);  //002655A0

  virtual bool WriteAsync(CFTTFile* pCFTTFile,
                          void const* write_buf,
                          int64 write_pos,
                          int64 write_len,
                          void* pDat,
                          CFTTAsyncEvent<TFTTFileAsyncEventData>* pEventData);  //0026564C

  int dThreadIndex_4;
  TAsyncOp* pTAsyncOp_begin_8;
  TAsyncOp* pTAsyncOp_end_C;
  bool field_10;
  FTTSemaphore FTTSemaphore_14;

  static TFTTFileAsyncEventData* ms_pDummyAsyncOp;
  static FTTMutex ms_tAsyncMutex;
  static CFTTMemPool_Resizing ms_tAsyncPool;  //005CB400
};

#endif  //_CFTTFILE_ASYNCQUEUE_H_