CMapStringToOb::RemoveAll

이 지도에서 모든 요소를 제거 하 고 소멸 된 CString key 개체.

void RemoveAll( );

설명

CObject 각 키에 의해 참조 된 개체를 소멸 됩니다.RemoveAll 함수에는 참조 되는 확인 하지 않습니다 경우 메모리 누수를 일으킬 수 있습니다 CObject 개체는 소멸 됩니다.

지도 이미 비어 있는 경우 함수를 제대로 작동 합니다.

다음 표에서 다른 멤버와 비슷한 함수를 보여 줍니다. CMapStringToOb::RemoveAll.

클래스

멤버 함수

CMapPtrToPtr

RemoveAll (void);

CMapPtrToWord

RemoveAll (void);

CMapStringToPtr

RemoveAll (void);

CMapStringToString

RemoveAll (void);

CMapWordToOb

RemoveAll (void);

CMapWordToPtr

RemoveAll (void);

예제

참조 하십시오 CObList::CObList 에 CAge 모든 컬렉션 예제에 사용 되는 클래스입니다.

{
   CMapStringToOb map;

   CAge age1(13); // Two objects on the stack
   CAge age2(36);
   map.SetAt(_T("Bart"), &age1);
   map.SetAt(_T("Homer"), &age2);
   ASSERT(map.GetCount() == 2);
   map.RemoveAll(); // CObject pointers removed; objects not removed.
   ASSERT(map.GetCount() == 0);
   ASSERT(map.IsEmpty());
} // The two CAge objects are deleted when they go out of scope.         

요구 사항

헤더: afxcoll.h

참고 항목

참조

CMapStringToOb 클래스

계층 구조 차트

CMapStringToOb::RemoveKey