aboutsummaryrefslogtreecommitdiffstats
path: root/toj/center/src/jmod_test_manage.h
blob: 811274a2a4e599b952f3a50785bc1e2535192773 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class manage_result_info{
public:
    int test_allcount;
    int test_count;
    int test_result;
    double test_totalscore;
    unsigned long test_totalruntime;
    unsigned long test_maxmemory;
    json_object *jso_res;
    json_object *jso_resarray;

    manage_result_info(int allcount){
        this->test_allcount = allcount;
        this->test_count = 0;
        this->test_result = JUDGE_AC;
        this->test_totalscore = 0;
        this->test_totalruntime = 0;
        this->test_maxmemory = 0;

        this->jso_res = json_object_new_object();
        this->jso_resarray = json_object_new_array();
        json_object_object_add(this->jso_res,"result",this->jso_resarray);
    }
    ~manage_result_info(){
        json_object_put(jso_res);
    }
};

DLL_PUBLIC int submit(judgm_manage_submitinfo *info,void **manage_data);
DLL_PUBLIC int result(judgm_manage_resultinfo *info,void *manage_data);

static void __attribute__ ((constructor)) manage_init();
static int manage_load_setfile(FILE *setfile,int &count);

static judgm_manage_queuesubmit_fn manage_queuesubmit_fn;