-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.cpp
49 lines (37 loc) · 992 Bytes
/
Application.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
#include "Application.h"
CApplication* CApplication::m_Instance = new CApplication();
CApplication::CApplication(void)
{
// m_procMutex = ACE_Process_Mutex(APPLICATION_ID);
}
CApplication::~CApplication(void)
{
m_procMutex.release();
CExchangeBuilder::instance()->CleanUp();
}
bool CApplication::Run( void )
{
ACE_Process_Mutex _procMutex(APPLICATION_ID);
if( -1 == _procMutex.tryacquire())
return false;
else
{
if (!CConfigurationManager::instance()->ReadFile("app.config"))
{
ACE_DEBUG( ( LM_DEBUG, "(%t) On %D\n" ) );
ACE_DEBUG( ( LM_DEBUG, "(%t) Unable to read app.configFile...\n\n" ) );
return false;
}
CExchangeBuilder::instance()->Init();
CConfigurationManager::instance()->Init();
//--- Message Loop ---------------------------
while(true)
{
if( kbhit() )
break;
ACE_Reactor::instance()->handle_events();
}
//--------------------------------------------
return true;
}
}