使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 0408576e9da10015ffa9da0079b8c985113ce4b3
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
63
64
65
66
67
68
69
70
71
72
73
#include "StdAfx.h"
#include "MBStrObjMgr.h"
 
 
CMBStrObjMgr::CMBStrObjMgr(void)
{
    RemoveAll();
}
 
 
CMBStrObjMgr::~CMBStrObjMgr(void)
{
    RemoveAll();
}
 
void        CMBStrObjMgr::GetObjMap( CMBStrObjMap &map)
{
    map.clear();
    m_map = map;
}
 
CMBStrObj  *CMBStrObjMgr::Get( CString strID )
{
    if( strID.IsEmpty() )
        return NULL;
 
    CMBStrObjMap::iterator    it; 
    CMBStrObj *pObj  = NULL;
 
    it = m_map.find(strID);
 
    if( it!= m_map.end() )
        pObj = it->second;
 
    return pObj;   
}  
 
bool        CMBStrObjMgr::Add( CMBStrObj *pObj )
{
    if( NULL ==  pObj || pObj->m_strID.IsEmpty() )
        return false;
 
    CMBStrObjMap::iterator    it; 
    CString strID;
 
    strID = pObj->m_strID;
    it = m_map.find(strID);
 
    // Èç¹ûÕҵõ½ ·µ»Ø
    if( it != m_map.end() )
        return false;
 
    m_map[strID] = pObj;     
     
    return true; 
}
 
bool        CMBStrObjMgr::RemoveAll()
{
    CMBStrObjMap::iterator    it; 
    CMBStrObj *pObj  = NULL;
 
    for( it = m_map.begin();it != m_map.end();it++ )
    {
        pObj = it->second;
        delete pObj;
        pObj = NULL;        
    }
 
    m_map.clear();  
     
    return true; 
}