Distribution_Service/Server/Task/TaskInfo.h

34 lines
840 B
C
Raw Normal View History

2025-12-04 18:12:54 +08:00
#ifndef DISTRIBUTION_SERVICE_TASK_INFO_H
#define DISTRIBUTION_SERVICE_TASK_INFO_H
#include "CCDatagramSocket.h"
#include "CCThreadPool.h"
#include "TL/Map.h"
#include "PushFlowTask.h"
class TaskInfo {
inline static CTL::Map<int,TaskInfo*> TaskInfoMap;
inline static CTL::DatagramSocket* socket = nullptr;
inline static std::shared_mutex mutex_socket;
public:
inline static CTL::ThreadPool thread_pool;
TaskInfo();
~TaskInfo();
void BitstreamHeartbeat();
int Flag = 0;
int Type = 0;
int TaskID = -1;
int TaskType = 0;
int ServerPort = 10060;
CTL::Map<int, int> Terms;
PushFlowTask* pushFlowTask = nullptr;
private:
public:
static void InitSocket();
static void Start(TaskInfo* taskInfo);
static void Stop(int TaskID);
static TaskInfo* getData(int TaskID);
};
#endif