-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmain.cpp
52 lines (40 loc) · 1.11 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
#include "nodeFactory.h"
#include "error.h"
#include "initData.h"
#include "eqEarth.h"
int main( const int argc, char** argv )
{
int ret = EXIT_FAILURE;
eqEarth::NodeFactory nodeFactory;
eqEarth::InitData initData;
//co::base::RefPtr< eqEarth::EQEarth > client;
lunchbox::RefPtr< eqEarth::EQEarth > client;
eqEarth::initErrors( );
if( !eq::init( argc, argv, &nodeFactory ))
{
LBERROR << "eq::init failed" << std::endl;
goto err;
}
if( !initData.parseCommandLine( argv, argc ))
{
LBERROR << "InitData::parseCommandLine failed" << std::endl;
goto err;
}
client = new eqEarth::EQEarth( initData );
if( !client->initLocal( argc, argv ))
{
LBERROR << "Client::initLocal failed" << std::endl;
goto out;
}
ret = client->run( );
client->exitLocal( );
LBASSERTINFO( client->getRefCount( ) == 1,
"Client still referenced by " << client->getRefCount( ) - 1 );
out:
client = 0;
if( !eq::exit( ))
LBWARN << "eq::exit failed" << std::endl;
err:
eqEarth::exitErrors( );
return ret;
}