-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
43 lines (39 loc) · 1.04 KB
/
main.cpp
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
42
43
/**
* @file main.cpp
* @author Michal Solanik
* @brief Main function
* @version 0.1
* @date 2021-07-09
*
* @details Main function is used to parse arguments and
* start new simulation with given parameters.
*
* @copyright Copyright (c) 2021
*
*/
#include <iostream>
#include "spdlog/spdlog.h"
#include "ParamsCarrier.hpp"
#include "ParseParams.hpp"
#include "AbstractAlgorithm.hpp"
#include "AbstractAlgorithmFactory.hpp"
int main(int argc, char **argv)
{
AbstractAlgorithmFactory *factory = AbstractAlgorithmFactory::CreateFactory(AbstractAlgorithmFactory::TYPE_ALGORITHM::COSMIC);
ParseParams *parse = new ParseParams();
if (parse->parseParams(argc, argv) != 1)
{
return -1;
}
ParamsCarrier *singleTone;
singleTone = parse->getParams();
AbstractAlgorithm *actualAlgorithm;
actualAlgorithm = factory->getAlgorithm(singleTone->getString("model", "1D Fp"));
if (actualAlgorithm == NULL)
{
spdlog::error("Selected custom model is not defined in factory.");
return -1;
}
actualAlgorithm->runAlgorithm(singleTone);
return 0;
}