task_param_manager.h 1.61 KB
/*
 * @Author: yangzilong
 * @Date: 2021-11-30 18:58:46
 * @Last Modified by: yangzilong
 * @Last Modified time: Do not edit
 * @Email: yangzilong@objecteye.com
 * @Description:
 */
#pragma once
#include "header.h"
#include "det_obj_header.h"

#include <map>
#include <set>
using namespace std;

struct algor_open_config_param
{
	set<algo_type> human_face_algors;
	set<algo_type> human_algors;
	set<algo_type> nonmotor_vehicle_algors;
	set<algo_type> vehicle_algors;
};

class task_param_manager
{
public:
	using algo_param_type_t_ = algor_init_config_param_t;

	static task_param_manager* getInstance()
	{
		static task_param_manager task_param_instance;
		return &task_param_instance;
	}

	void add_task_param(string task_id, task_param task_param);
	void delete_task_param(string task_id);
	const algor_open_config_param *const get_task_algor_param(const string &task_id);
	const map<algo_type, algo_param_type_t_*> *const get_task_other_param(const string& task_id);
	const algo_param_type_t_ *const get_task_other_param(const string& task_id, const algo_type &_algo_type);

	map<string, algor_open_config_param> get_task_algor_params();
	map<string, map<algo_type, algo_param_type_t_*>> get_task_other_params();
	void task_param_manager_release();

	bool task_has_vpt_algor(const std::string &task_id);
	bool task_has_face_algor(const std::string &task_id);

	int get_video_timing_snapshot_interval(std::string& task_id);

private:
	task_param_manager();
	task_param_manager(const task_param_manager& other);

	map<string, map<algo_type, algo_param_type_t_*>>  m_task_params;
	map<string, algor_open_config_param>  m_algor_config_params;
};