-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExchangeBuilder.cpp
62 lines (47 loc) · 1.87 KB
/
ExchangeBuilder.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
58
59
60
61
62
// ExchangeBuilder2.cpp: implementation of the ExchangeBuilder2 class.
//
//////////////////////////////////////////////////////////////////////
#include "ExchangeBuilder.h"
#include "ExchangeHandler.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CExchangeBuilder* CExchangeBuilder::m_ExchangeBuilder = new CExchangeBuilder();
CExchangeBuilder::~CExchangeBuilder()
{
}
bool CExchangeBuilder::Init()
{
STExchangeConnectionInfo oExConInfo;
bool _ret = true;
STExchangeConnectionInfoList _ExConList = CConfigurationManager::instance()->m_ExchangeInfoList;
STExchangeConnectionInfoList::iterator itExConInfo = _ExConList.begin();
//--- Iterate all Exchange Connection Info -------------------------
for ( ; itExConInfo != _ExConList.end() ; itExConInfo++)
{
oExConInfo = (STExchangeConnectionInfo) *itExConInfo;
CExchangeHandler *oExComm = new CExchangeHandler(oExConInfo);
if (oExConInfo.Enabled)
{
_ret = oExComm->Create();
}
m_ExchangeHandlerList.push_back( oExComm );
}
//-------------------------------------------------------------------
return _ret;
}
bool CExchangeBuilder::CleanUp( void )
{
bool _ret = true;
STExchangeConnectionInfoList _ExConList = CConfigurationManager::instance()->m_ExchangeInfoList;
ACE_Vector<CExchangeHandler*>::iterator itExchangeHandler = m_ExchangeHandlerList.begin();
//--- Iterate all Exchange Connection Info -------------------------
for ( ; itExchangeHandler != m_ExchangeHandlerList.end() ; itExchangeHandler++)
{
_ret &= ((CExchangeHandler*)*itExchangeHandler)->Destroy();
m_ExchangeHandlerList.pop_back();
}
//-------------------------------------------------------------------
m_ExchangeHandlerList.clear();
return _ret;
}