12345678910111213141516171819202122232425262728293031323334 |
- #include <iostream>
- #include <signal.h>
- #include "TestApp.hpp"
- using namespace std;
- int main(int argc, char* argv[]){
- static semaphore sem;
- signal(SIGINT, [](int) {
- sem.post();
- NoticeCenter::Instance().emitEvent(NOTICE_DESTROY);
- });
- Logger::Instance().add(std::make_shared<ConsoleChannel>());
- Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
- gsd::TestApp::Ptr app = gsd::TestApp::CreateNew();
- if(app == nullptr){
- ErrorL << "App unable to create"<<endl;
- return -1;
- }
- if(app->Init()==false){
- ErrorL << "Failed to start task"<<endl;
- }
-
- app->StartTask();
- sem.wait();
- InfoL<<"app Destroy"<<endl;
- app->Destroy();
- return 0;
- }
|