-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
57 lines (49 loc) · 1.34 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the COPYING file.
*/
#include <boost/shared_ptr.hpp>
#ifndef _WIN32
# include <signal.h>
#endif
#include <alcommon/albroker.h>
#include <alcommon/albrokermanager.h>
#include <alcommon/altoolsmain.h>
#include "naointerface.h"
#ifdef NAO_IS_REMOTE
# define ALCALL
#else
// When not remote, we are in a dll, so export the entry point
# ifdef _WIN32
# define ALCALL __declspec(dllexport)
# else
# define ALCALL
# endif
#endif
extern "C"
{
ALCALL int _createModule(boost::shared_ptr<AL::ALBroker> broker)
{
// Init broker with the main braoker instance
// from the parent executable
AL::ALBrokerManager::setInstance(broker->fBrokerManager.lock());
AL::ALBrokerManager::getInstance()->addBroker(broker);
// Create module instances
AL::ALModule::createModule<IAL::NaoInterface>(broker, "IAL::NaoInterface");
return 0;
}
ALCALL int _closeModule()
{
return 0;
}
} // extern "C"
#ifdef NAO_IS_REMOTE
int main(int argc, char * argv[])
{
// Pointer to createModule
TMainType sig = &_createModule;
// Call main
return ALTools::mainFunction("IAL::NaoInterface", argc, argv, sig);
}
#endif