summaryrefslogtreecommitdiffstats
path: root/veslibrary/ves_cpplibrary/src/lib/encode/XLoadImp.cpp
blob: 548686c152f0627b0de759ec5b4f100834b72ccd (plain)
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
36
37
38
39
40
41
#include "XLoadImp.h"

XLoadImp::XLoadImp():XLoad(nullptr)
{

}

void XLoadImp::setShortTerm(XNumber shortTerm)
{
    comVals_["shortTerm"] = shortTerm;
}
            
void XLoadImp::setLongTerm(XNumber longTerm)
{
    comVals_["longTerm"] = longTerm;
}
            
void XLoadImp::setMidTerm(XNumber midTerm)
{
    comVals_["midTerm"] = midTerm;
}

json XLoadImp::toJson()
{
    try
    {
        json field;

        //optional val
        
        field = mergeCommonValues(field, comVals_);

        return field;
    }
    catch (json::exception& e)
    {
        SPDLOG_ERROR("Fail to build XLoad to json object:{}.", e.what());
        return json();
    }
}