//CFTTJobList - [2020-04-13 11:57:46]
#ifndef _CFTTJOBLIST_H_
#define _CFTTJOBLIST_H_

#include "CFTTJob.h"
#include "FTTMutex.h"

/*
00265A2E CFTTJobList::CFTTJobList(int)
00265AB0 CFTTJobList::~CFTTJobList()
00265AC4 CFTTJobList::InsertJob(CFTTJob *)
00265AF8 CFTTJobList::AddReservedJob(void (*)(CFTTJob *,void *),void*,CFTTAsyncEvent<CFTTJob *> *)
00265B38 CFTTJobList::IsEmpty()
00265B44 CFTTJobList::RemoveJob()
00265B74 CFTTJobList::ReturnReservedJob(CFTTJob*)
*/

struct JobArrayInfo {
  int size;
  int count;
  CFTTJob list[2];
};

class CFTTJobList {
public:
  CFTTJobList(int count);       //00265A2E
  ~CFTTJobList();               //00265AB0
  bool InsertJob(CFTTJob* a2);  //00265AC4
  bool AddReservedJob(Func_Job func,
                      void* func_arg,
                      CFTTAsyncEvent<CFTTJob*>* pEvent);  //00265AF8
  bool IsEmpty();                                         //00265B38
  CFTTJob* RemoveJob();                                   //00265B44
  void ReturnReservedJob(CFTTJob* a2);                    //00265B74

  CFTTJob* list_end_0;
  CFTTJob* dynamic_list_begin_4;  //动态链表开始结点
  CFTTJob** dynamic_list_end_8;   //动态链表结尾结点
  CFTTJob* list_begin_C;

  //--------------------------
  //uint8*  new_data; //原始代码没有这个字段， 为了方便增加这个字段
  //                 //根据 list_begin_C - 8 算出来的

  static FTTMutex ms_tMutex;
};

#endif  //_CFTTJOBLIST_H_