조회 수 47192 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print

인클루드 <afxtempl.h>


CList<타입,타입&> list;

 

여기서 POSITION (pos)를 따로 선언하여 필요할 때 사용.


<-  Tail  ---------------  Head  ->

<-  Next  ---------------  Prev  ->

<-  After  ---------------  Before  ->

 

List 안에 있는 값을 얻을 때 개수 범위가 넘었는지를 확인 해주어야 한다. 안그러면 ASSERT 발동

 

Head/Tail 접근

GetHead list의 head element를 리턴한다. (empty면 할 수 없다).
GetTail list의 tail element를 리턴한다.(empty면 할 수 없다).

Operations(조정)

AddHead
 하나의 element(또는 다른 list의 모든element들)을 list의 head에 추가한다(새로운 head를 만든다).
 
AddTail 하나의 element(또는 다른 list의 모든element들)을 list의 tail에 추가한다(새로운 tail를 만든다).
 
RemoveAll list의 모든 element를 제거한다.
RemoveHead list의 head로부터 element를 제거한다.
RemoveTail list의 tail로부터 element를 제거한다.

Iteration(반복)

GetHeadPosition head의 position을 리턴한다.
GetNext (position이) 반복되어 다음 element로 도달한다.(원래 인수로 넣었던 position의 값으로 리턴하고 position을 다음 위치로 바꿔진다)
 
GetPrev (position이) 반복되어 이전 element로 도달한다.(원래 인수로 넣었던 position의 값으로 리턴하고 position을 이전 위치로 바꿔진다)
 
GetTailPosition tail  position을 리턴한다.

Retrieval(정정)/Modification(수정)

GetAt 주어진 position에서 element(값)을 얻는다.
RemoveAt position에 의해 정해진 element 를 list로부터 제거한다.
SetAt 주어진 position에서 element(값)을 넣는다.

Insertion(삽입)

InsertAfter 주어진 position 뒤에 새로운 element를 삽입한다.
InsertBefore 주어진 position 앞에 새로운 element를 삽입한다.

Searching(찾기)

Find pointer 값에 의해 정해진 position을 얻는다.
FindIndex zero-based index 값에 의해 정해진 position을 얻는다.

Status(상태)

GetCount list의 element 개수를 리턴한다 
GetSize list의 element 개수를 리턴한다
IsEmpty 비어있는 상태인지 검사한다.(no elements).





헤더파일 : #include <afxtempl.h>


설정 : Project Setting - General - Microsoft Foundation Classes ->
        Static 또는 Share dll MFC(MFC 사용하도록 설정)


선언 : CList< class TYPE, class ARG_TYPE > VarName;
TYPE
Type of object stored in the list.
ARG_TYPE
Type used to reference objects stored in the list. Can be a reference.


리스트 탐색:
POSITION pos = VarName.GetHeadPosition(); 
while(pos != NULL) 
{
    TYPE cur = VarName.GetNext(pos);   // SomeThing To do 
}


Dreamy의 코드 스크랩

내가 모으고 내가 보는

List of Articles
번호 분류 제목 날짜 조회 수 추천 수
311 Python BeautifulSoup로 HTML 파싱 끝내기 2013.04.08 42910 0
310 Python python 문법요약 2013.04.08 28862 0
309 C# Quick Sort 함수 2013.04.17 10103 0
308 Android adb 로 low battery 이벤트 날리기 2013.04.19 17060 0
307 Android CDMA 모델에서의 IMEI secret 2013.04.22 0 0
306 LINUX 사용자 계정 목록 보기 2013.04.22 16232 0
305 C# Textbox에 숫자만 입력가능하게 설정하기 2013.04.22 21118 0
304 Android 이클립스(Eclipse)에서 유용한 단축키 일람 1 2013.05.21 39422 0
303 Android repo 명령어 (command) 설명 init sync diff prune forall upload download start status 2013.05.30 20722 0
302 Android ADB Usage 번역 2013.07.10 13514 0
301 LINUX shutdown 명령어 2013.07.26 10423 0
300 일반 장치관리자 실행 명령어 2013.08.05 15029 0
299 C# 트레이 아이콘 만들기 2013.08.05 13425 0
298 C# LDAP Active Directory 계정에서 사진 얻어오기 2013.08.07 11560 0
297 C# 사용자 정의 이벤트(event) 예제 2013.08.08 12169 0
목록
Board Pagination ‹ Prev 1 ... 9 10 11 12 13 14 15 16 17 18 ... 34 Next ›
/ 34

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소

Designed by sketchbooks.co.kr / sketchbook5 board skin

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5