#include <iostream>
#include <signal.h>
#include "Util/logger.h"
#include "Util/NoticeCenter.h"

#include "ins_Packet.hpp"
#include "GetCenter.hpp"
#include "ProcessingIt.hpp"
#include "TaskCenter.hpp"
#include "Disposition.hpp"
#include "dataTypeList.hpp"

using namespace std;
using namespace toolkit;
using namespace ins;

int main(int argc, char *argv[])
{
    //设置退出信号处理函数
    static semaphore sem;
    signal(SIGINT, [](int) { sem.post(); });// 设置退出信号

    // 设置日志
    Logger::Instance().add(std::make_shared<ConsoleChannel>());
    Logger::Instance().add(std::make_shared<FileChannel>());
    Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());

    TaskCenter::Ptr taskCenter = TaskCenter::CreateNew();
    Disposition::Ptr disposition = Disposition::getPtr();
    GetCenter::Ptr getCenter = GetCenter::CreateNew();

    disposition->Update();
    getCenter->getApolloList();
    getCenter->getKsToken();
    getCenter->getKsServices();
    
    sem.wait(); // describe
    return 0;
}
