-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
50 lines (43 loc) · 1.03 KB
/
main.cpp
File metadata and controls
50 lines (43 loc) · 1.03 KB
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
44
45
46
47
48
49
50
#pragma once
#ifndef _WIN32
# include <signal.h>
#endif
#include <alcommon/albroker.h>
#include <alcommon/albrokermanager.h>
#include <alcommon/altoolsmain.h>
#ifdef CLOCALIZATION_IS_REMOTE
# include "remoteloc.h"
#else
# include "clocalization.h"
#endif
extern "C"
{
int _createModule(boost::shared_ptr<AL::ALBroker> pBroker)
{
// init broker with the main broker instance
// from the parent executable
AL::ALBrokerManager::setInstance(pBroker->fBrokerManager.lock());
AL::ALBrokerManager::getInstance()->addBroker(pBroker);
// create module instances
#ifdef CLOCALIZATION_IS_REMOTE
AL::ALModule::createModule<RemoteLoc>(pBroker, "RemoteLoc");
#else
AL::ALModule::createModule<CLocalization>(pBroker, "CLocalization");
#endif
return 0;
}
int _closeModule( )
{
return 0;
}
} // extern "C"
#ifdef CLOCALIZATION_IS_REMOTE
int main(int argc, char *argv[])
{
// pointer to createModule
TMainType sig;
sig = &_createModule;
// call main
return ALTools::mainFunction("RemoteLoc", argc, argv, sig);
}
#endif