CMap은 자료형이 자유로운 딕셔너리 컬렉션 클래스.
A dictionary collection class that maps unique keys to values.
Once you have inserted a key-value pair (element) into the map, you can efficiently retrieve or delete the pair using the key to access it. You can also iterate over all the elements in the map.
A variable of type POSITION is used for alternate access to entries. You can use a POSITION to "remember" an entry and to iterate through the map. You might think that this iteration is sequential by key value; it is not. The sequence of retrieved elements is indeterminate.
Certain member functions of this class call global helper functions that must be customized for most uses of the CMap class. See Collection Class Helpers in the Macros and Globals section of the MFCReference.
CMap overrides CObject::Serialize to support serialization and dumping of its elements. If a map is stored to an archive using Serialize, each map element is serialized in turn. The default implementation of the SerializeElements helper function does a bitwise write. For information about serialization of pointer collection items derived from CObject or other user defined types, see How to: Make a Type-Safe Collection.
If you need a diagnostic dump of the individual elements in the map (the keys and values), you must set the depth of the dump context to 1 or greater.
When a CMap object is deleted, or when its elements are removed, the keys and values both are removed.
Map class derivation is similar to list derivation. See the article Collections for an illustration of the derivation of a special-purpose list class.
CMap map<CString, LPCTSTR, int, int> map; 으로 정의했다면.
첫등록 : 2016년 1월 30일
최종수정 : 2019년 5월 24일
본 글 단축주소 : https://igotit.tistory.com/644
'VisualStudio.C++.C# > 코딩팁,함수활용,단편' 카테고리의 다른 글
|_WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h) (0)||2019.12.08|
|C. static 함수 선언. (0)||2019.10.21|
|MFC CMap Class. 등 자료형 자유로운 딕셔너리(사전) 컬렉션. (0)||2019.05.24|
|calling convention. __cdecl, __stdcall . 호출규약 (0)||2019.05.13|
|memcmp, memcpy, memset (0)||2019.03.13|
|float 형 변수에 할당된 4바이트 메모리의 각 바이트 단위로 접근하는법. (0)||2019.02.20|