1 #include "OdbServerAppBase.h"
6 namespace Odb::Lib::App
8 OdbAppBase::OdbAppBase(
int argc,
char* argv[])
9 : m_designCache(DEFAULT_DESIGNS_DIR)
10 , m_commandLineArgs(argc, argv)
12 GOOGLE_PROTOBUF_VERIFY_VERSION;
15 OdbAppBase::~OdbAppBase()
17 Logger::instance()->stop();
18 google::protobuf::ShutdownProtobufLibrary();
21 const OdbDesignArgs& OdbAppBase::args()
const
23 return m_commandLineArgs;
26 DesignCache& OdbAppBase::designs()
31 Utils::ExitCode OdbAppBase::Run()
34 Logger::instance()->logLevel(Logger::Level::Info);
35 Logger::instance()->start();
38 if (!args().designsDir().empty())
40 designs().setDirectory(args().designsDir());
44 if (!args().loadDesign().empty())
49 designs().GetDesign(args().loadDesign());
51 if (pFileArchive ==
nullptr)
53 logerror(
"Failed to load design specified in arguments \"" + args().loadDesign() +
"\"");
54 return Utils::ExitCode::FailedInitLoadDesign;
57 catch (std::exception&)
60 logerror(
"Failed to load design specified in arguments \"" + args().loadDesign() +
"\"");
61 return Utils::ExitCode::FailedInitLoadDesign;
68 designs().loadAllDesigns(
false);
71 return Utils::ExitCode::Success;