SlideShare uma empresa Scribd logo
1 de 26
Track :: 알고리즘과 고급 토픽 9장  |STL 고급 각 개체들의 효율적인 연결 방법 10장  |   추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 알고리즘과 고급 토픽 9장  |STL 고급 각 개체들의 효율적인 연결 방법 10장  |   추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 알고리즘과 고급 토픽 9장  |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 9장  |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Functor(함수자 또는 함수 객체)란? -operator()를 연산자 오버로드 하고 있는 클래스의 객체-인자를 전달하는 과정의 편리함. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 9장  |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
FunctorAdapter -일반 함수, 함수 포인터, 함수자를 인자로 받아서  새로운 함수자를 생성한다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Binder (bind1st, bind2nd) 이항 함수자를 단항 함수자로 변경 binder1st< less<int> > binder = bind1st(less<int>(), 10 ); // bind1st과 param2 비교  (L < R) ? 	cout << binder(5)<<endl; 	cout << less<int>()(10, 5)<< endl; 	cout << bind1st(less<int>(), 10 )(5)<<endl; binder2nd< less<int> > binder= bind2nd(less<int>(), 5); // param1과 bind2nd 비교  (L < R) ? 	cout << binder(10) << endl; 	cout << less<int>() (10, 5) << endl; 	cout << bind2nd(less<int>(), 5 )(10) << endl; 2nd 1st Functor http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 9장  |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Algorithm -STL의 많은 부분이 알고리즘으로 구성되어 있다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Algorithm (변형 불가) :: Find -모든 항목 사이를 반복하면서 항목을 찾음-규칙성이 없는 상황에만 사용하는 것이 좋다. :: For_each -컨테이너 각 요소에 대하여 특정 함수를 실행 (향상된 for문) :: Count -전체 요소 수를 알고자 할때는 size() 사용count는 특정 조건에 맞는 요소만 센다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 9장  |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
String -STL내에 string클래스를 제공한다. -필요에 따라 크기가 늘어난다. :: 성능에 대한 고려 문자열 리터럴을 그대로 전달하는 과정의 복사 조심 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
String을 대신 할 수 있는 것들 Rope -표준이 아닌 템플릿 클래스-rope< type, allocator> -아주 긴 문자열을 하나의 단위로 작업 가능 (작은 문자 비효율적) CString -MFC STL과 호환 불가 Vector<char> -char 배열과 유사 -참조 카운팅 가능, CoW(Copy on Write) http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 알고리즘과 고급 토픽 9장  |STL 고급 각 개체들의 효율적인 연결 방법 10장  |   추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 알고리즘과 고급 토픽 9장  |STL 고급 각 개체들의 효율적인 연결 방법 10장  |   추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 인터페이스? 격리 설계 팩토리 패턴 확장 10장  |   추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 10장  |   추상 인터페이스 인터페이스? 격리 설계 팩토리 패턴 단점? http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Interface 개념 -추상 인터페이스는 순수 가상 함수이다. -추상 인터페이스는 껍데기이다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 10장  |   추상 인터페이스 인터페이스? 격리 설계 팩토리 패턴 단점? http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Interface ::격리 설계 예제> 다중 플랫폼(OpenGL, DirectX)에 구애받지 않는 설계(층 분리) class IGraphicsRenderer { 	virtual void Redner(…)= 0; } class Renderer_D3D	: public IGraphicsRenderer { 	virtual void Redner(…)= 0; } class Renderer_OGL	: public IGraphicsRenderer { 	virtual void ~Redner(…)= 0; } IGraphicsRenderer* g_pRenderer= new GraphicsRendererOGL(); = new GraphicsRendererD3D(); http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 10장  |   추상 인터페이스 인터페이스? 격리 설계 팩토리 패턴 단점? http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Interface ::팩토리 패턴 격리 설계를 할 경우-> 헤더 파일의 크기 Interface 팩토리 패턴을 통한 완전한 분리 OGL D3D GraphicsRenderFactory GraphicsRenderFactory factory; IGraphicsRenderer* g_pRenderer; g_pRenderer = factory.CreateRenderer(“OGL”); g_pRenderer = factory.CreateRenderer(“D3D”); http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Track :: 10장  |   추상 인터페이스 인터페이스? 격리 설계 팩토리 패턴 단점? http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
Interface ::단점 -코드의 복잡성 증가 -디버그가 어려워 진다. (추상 인터페이스형이 비어있는 경우) -가상 함수로 인한 성능 저하 -위와 같은 단점들이 해를 입히는 데미지보다추상 인터페이스 구현으로 인해 얻는 것들이 더 많기 때문에 적극적으로 활용 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
감사합니다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr

Mais conteúdo relacionado

Semelhante a STL활용, abstract interface

파이썬 플라스크 이해하기
파이썬 플라스크 이해하기 파이썬 플라스크 이해하기
파이썬 플라스크 이해하기 Yong Joon Moon
 
About Visual C++ 10
About  Visual C++ 10About  Visual C++ 10
About Visual C++ 10흥배 최
 
R2서버정진욱
R2서버정진욱R2서버정진욱
R2서버정진욱jungjinwouk
 
[Swift] Protocol (1/2)
[Swift] Protocol (1/2)[Swift] Protocol (1/2)
[Swift] Protocol (1/2)Bill Kim
 
Cse342 chapter 04
Cse342 chapter 04Cse342 chapter 04
Cse342 chapter 04Jinil Nam
 
AWS CLOUD 2018- 관리형 Kubernetes 지원과 새로운 컨테이너 서비스 Amazon Fargate 소개 (정영준 솔루션즈 아...
AWS CLOUD 2018- 관리형 Kubernetes 지원과 새로운 컨테이너 서비스 Amazon Fargate 소개 (정영준 솔루션즈 아...AWS CLOUD 2018- 관리형 Kubernetes 지원과 새로운 컨테이너 서비스 Amazon Fargate 소개 (정영준 솔루션즈 아...
AWS CLOUD 2018- 관리형 Kubernetes 지원과 새로운 컨테이너 서비스 Amazon Fargate 소개 (정영준 솔루션즈 아...Amazon Web Services Korea
 
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇BOAZ Bigdata
 
Mastering ethereum(smart contract)
Mastering ethereum(smart contract)Mastering ethereum(smart contract)
Mastering ethereum(smart contract)제호 송
 
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축BOAZ Bigdata
 
송창규, unity build로 빌드타임 반토막내기, NDC2010
송창규, unity build로 빌드타임 반토막내기, NDC2010송창규, unity build로 빌드타임 반토막내기, NDC2010
송창규, unity build로 빌드타임 반토막내기, NDC2010devCAT Studio, NEXON
 
(C#,네트워크강좌)간단한 TCP 클라이언트/서버 구현, 멀티쓰레드 기반 에코우 클라이언트/서버_C추천#/WPF/자마린실무교육학원
(C#,네트워크강좌)간단한 TCP 클라이언트/서버 구현, 멀티쓰레드 기반 에코우 클라이언트/서버_C추천#/WPF/자마린실무교육학원(C#,네트워크강좌)간단한 TCP 클라이언트/서버 구현, 멀티쓰레드 기반 에코우 클라이언트/서버_C추천#/WPF/자마린실무교육학원
(C#,네트워크강좌)간단한 TCP 클라이언트/서버 구현, 멀티쓰레드 기반 에코우 클라이언트/서버_C추천#/WPF/자마린실무교육학원탑크리에듀(구로디지털단지역3번출구 2분거리)
 
스위프트 성능 이해하기
스위프트 성능 이해하기스위프트 성능 이해하기
스위프트 성능 이해하기Yongha Yoo
 
RESTful API 설계
RESTful API 설계RESTful API 설계
RESTful API 설계Jinho Yoo
 
Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018
Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018
Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018Amazon Web Services Korea
 
Introduction to Apache Tajo
Introduction to Apache TajoIntroduction to Apache Tajo
Introduction to Apache TajoGruter
 
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임KH Park (박경훈)
 
Versatile tensor accelerator (vta) introduction and usage
Versatile tensor accelerator (vta) introduction and usage Versatile tensor accelerator (vta) introduction and usage
Versatile tensor accelerator (vta) introduction and usage jemin lee
 
[D2 CAMPUS] 안드로이드 오픈소스 스터디자료 - Http Request
[D2 CAMPUS] 안드로이드 오픈소스 스터디자료 - Http Request[D2 CAMPUS] 안드로이드 오픈소스 스터디자료 - Http Request
[D2 CAMPUS] 안드로이드 오픈소스 스터디자료 - Http RequestNAVER D2
 
병렬 프로그래밍
병렬 프로그래밍병렬 프로그래밍
병렬 프로그래밍준혁 이
 

Semelhante a STL활용, abstract interface (20)

파이썬 플라스크 이해하기
파이썬 플라스크 이해하기 파이썬 플라스크 이해하기
파이썬 플라스크 이해하기
 
About Visual C++ 10
About  Visual C++ 10About  Visual C++ 10
About Visual C++ 10
 
llvm 소개
llvm 소개llvm 소개
llvm 소개
 
R2서버정진욱
R2서버정진욱R2서버정진욱
R2서버정진욱
 
[Swift] Protocol (1/2)
[Swift] Protocol (1/2)[Swift] Protocol (1/2)
[Swift] Protocol (1/2)
 
Cse342 chapter 04
Cse342 chapter 04Cse342 chapter 04
Cse342 chapter 04
 
AWS CLOUD 2018- 관리형 Kubernetes 지원과 새로운 컨테이너 서비스 Amazon Fargate 소개 (정영준 솔루션즈 아...
AWS CLOUD 2018- 관리형 Kubernetes 지원과 새로운 컨테이너 서비스 Amazon Fargate 소개 (정영준 솔루션즈 아...AWS CLOUD 2018- 관리형 Kubernetes 지원과 새로운 컨테이너 서비스 Amazon Fargate 소개 (정영준 솔루션즈 아...
AWS CLOUD 2018- 관리형 Kubernetes 지원과 새로운 컨테이너 서비스 Amazon Fargate 소개 (정영준 솔루션즈 아...
 
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
제 19회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [백발백준] : 백준봇 : 컨테이너 오케스트레이션 기반 백준 문제 추천 봇
 
Mastering ethereum(smart contract)
Mastering ethereum(smart contract)Mastering ethereum(smart contract)
Mastering ethereum(smart contract)
 
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
제 17회 보아즈(BOAZ) 빅데이터 컨퍼런스 - [Catch, Traffic!] : 지하철 혼잡도 및 키워드 분석 데이터 파이프라인 구축
 
송창규, unity build로 빌드타임 반토막내기, NDC2010
송창규, unity build로 빌드타임 반토막내기, NDC2010송창규, unity build로 빌드타임 반토막내기, NDC2010
송창규, unity build로 빌드타임 반토막내기, NDC2010
 
(C#,네트워크강좌)간단한 TCP 클라이언트/서버 구현, 멀티쓰레드 기반 에코우 클라이언트/서버_C추천#/WPF/자마린실무교육학원
(C#,네트워크강좌)간단한 TCP 클라이언트/서버 구현, 멀티쓰레드 기반 에코우 클라이언트/서버_C추천#/WPF/자마린실무교육학원(C#,네트워크강좌)간단한 TCP 클라이언트/서버 구현, 멀티쓰레드 기반 에코우 클라이언트/서버_C추천#/WPF/자마린실무교육학원
(C#,네트워크강좌)간단한 TCP 클라이언트/서버 구현, 멀티쓰레드 기반 에코우 클라이언트/서버_C추천#/WPF/자마린실무교육학원
 
스위프트 성능 이해하기
스위프트 성능 이해하기스위프트 성능 이해하기
스위프트 성능 이해하기
 
RESTful API 설계
RESTful API 설계RESTful API 설계
RESTful API 설계
 
Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018
Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018
Amazon EC2 고급 활용 기법 및 모범 사례::이진욱::AWS Summit Seoul 2018
 
Introduction to Apache Tajo
Introduction to Apache TajoIntroduction to Apache Tajo
Introduction to Apache Tajo
 
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
 
Versatile tensor accelerator (vta) introduction and usage
Versatile tensor accelerator (vta) introduction and usage Versatile tensor accelerator (vta) introduction and usage
Versatile tensor accelerator (vta) introduction and usage
 
[D2 CAMPUS] 안드로이드 오픈소스 스터디자료 - Http Request
[D2 CAMPUS] 안드로이드 오픈소스 스터디자료 - Http Request[D2 CAMPUS] 안드로이드 오픈소스 스터디자료 - Http Request
[D2 CAMPUS] 안드로이드 오픈소스 스터디자료 - Http Request
 
병렬 프로그래밍
병렬 프로그래밍병렬 프로그래밍
병렬 프로그래밍
 

Mais de Mark Choi

GameMath-Chapter 13 발사체
GameMath-Chapter 13 발사체GameMath-Chapter 13 발사체
GameMath-Chapter 13 발사체Mark Choi
 
GameMath-Chapter 10 다각형기법
GameMath-Chapter 10 다각형기법GameMath-Chapter 10 다각형기법
GameMath-Chapter 10 다각형기법Mark Choi
 
GameMath-Chapter 09 가시성판단
GameMath-Chapter 09 가시성판단GameMath-Chapter 09 가시성판단
GameMath-Chapter 09 가시성판단Mark Choi
 
GameMath-Chapter 08 고급렌더링
GameMath-Chapter 08 고급렌더링GameMath-Chapter 08 고급렌더링
GameMath-Chapter 08 고급렌더링Mark Choi
 
GameMath-Chapter 07 조명
GameMath-Chapter 07 조명GameMath-Chapter 07 조명
GameMath-Chapter 07 조명Mark Choi
 
GameMath-Chapter 06 카메라
GameMath-Chapter 06 카메라GameMath-Chapter 06 카메라
GameMath-Chapter 06 카메라Mark Choi
 
GameMath-Chapter 03 변환
GameMath-Chapter 03 변환GameMath-Chapter 03 변환
GameMath-Chapter 03 변환Mark Choi
 
Chapter 02 행렬
Chapter 02 행렬Chapter 02 행렬
Chapter 02 행렬Mark Choi
 
GameMath-Chapter 11 운동학
GameMath-Chapter 11 운동학GameMath-Chapter 11 운동학
GameMath-Chapter 11 운동학Mark Choi
 
GameMath-Chapter 01 벡터
GameMath-Chapter 01 벡터GameMath-Chapter 01 벡터
GameMath-Chapter 01 벡터Mark Choi
 
로그라이크 (Rogue like)
로그라이크 (Rogue like)로그라이크 (Rogue like)
로그라이크 (Rogue like)Mark Choi
 
9장10장,stl abstract interface
9장10장,stl abstract interface9장10장,stl abstract interface
9장10장,stl abstract interfaceMark Choi
 
6장 performance of game_최준혁_2
6장 performance of game_최준혁_26장 performance of game_최준혁_2
6장 performance of game_최준혁_2Mark Choi
 

Mais de Mark Choi (13)

GameMath-Chapter 13 발사체
GameMath-Chapter 13 발사체GameMath-Chapter 13 발사체
GameMath-Chapter 13 발사체
 
GameMath-Chapter 10 다각형기법
GameMath-Chapter 10 다각형기법GameMath-Chapter 10 다각형기법
GameMath-Chapter 10 다각형기법
 
GameMath-Chapter 09 가시성판단
GameMath-Chapter 09 가시성판단GameMath-Chapter 09 가시성판단
GameMath-Chapter 09 가시성판단
 
GameMath-Chapter 08 고급렌더링
GameMath-Chapter 08 고급렌더링GameMath-Chapter 08 고급렌더링
GameMath-Chapter 08 고급렌더링
 
GameMath-Chapter 07 조명
GameMath-Chapter 07 조명GameMath-Chapter 07 조명
GameMath-Chapter 07 조명
 
GameMath-Chapter 06 카메라
GameMath-Chapter 06 카메라GameMath-Chapter 06 카메라
GameMath-Chapter 06 카메라
 
GameMath-Chapter 03 변환
GameMath-Chapter 03 변환GameMath-Chapter 03 변환
GameMath-Chapter 03 변환
 
Chapter 02 행렬
Chapter 02 행렬Chapter 02 행렬
Chapter 02 행렬
 
GameMath-Chapter 11 운동학
GameMath-Chapter 11 운동학GameMath-Chapter 11 운동학
GameMath-Chapter 11 운동학
 
GameMath-Chapter 01 벡터
GameMath-Chapter 01 벡터GameMath-Chapter 01 벡터
GameMath-Chapter 01 벡터
 
로그라이크 (Rogue like)
로그라이크 (Rogue like)로그라이크 (Rogue like)
로그라이크 (Rogue like)
 
9장10장,stl abstract interface
9장10장,stl abstract interface9장10장,stl abstract interface
9장10장,stl abstract interface
 
6장 performance of game_최준혁_2
6장 performance of game_최준혁_26장 performance of game_최준혁_2
6장 performance of game_최준혁_2
 

STL활용, abstract interface

  • 1. Track :: 알고리즘과 고급 토픽 9장 |STL 고급 각 개체들의 효율적인 연결 방법 10장 | 추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 2. Track :: 알고리즘과 고급 토픽 9장 |STL 고급 각 개체들의 효율적인 연결 방법 10장 | 추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 3. Track :: 알고리즘과 고급 토픽 9장 |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 4. Track :: 9장 |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 5. Functor(함수자 또는 함수 객체)란? -operator()를 연산자 오버로드 하고 있는 클래스의 객체-인자를 전달하는 과정의 편리함. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 6. Track :: 9장 |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 7. FunctorAdapter -일반 함수, 함수 포인터, 함수자를 인자로 받아서 새로운 함수자를 생성한다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 8. Binder (bind1st, bind2nd) 이항 함수자를 단항 함수자로 변경 binder1st< less<int> > binder = bind1st(less<int>(), 10 ); // bind1st과 param2 비교 (L < R) ? cout << binder(5)<<endl; cout << less<int>()(10, 5)<< endl; cout << bind1st(less<int>(), 10 )(5)<<endl; binder2nd< less<int> > binder= bind2nd(less<int>(), 5); // param1과 bind2nd 비교 (L < R) ? cout << binder(10) << endl; cout << less<int>() (10, 5) << endl; cout << bind2nd(less<int>(), 5 )(10) << endl; 2nd 1st Functor http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 9. Track :: 9장 |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 10. Algorithm -STL의 많은 부분이 알고리즘으로 구성되어 있다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 11. Algorithm (변형 불가) :: Find -모든 항목 사이를 반복하면서 항목을 찾음-규칙성이 없는 상황에만 사용하는 것이 좋다. :: For_each -컨테이너 각 요소에 대하여 특정 함수를 실행 (향상된 for문) :: Count -전체 요소 수를 알고자 할때는 size() 사용count는 특정 조건에 맞는 요소만 센다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 12. Track :: 9장 |STL 고급 Functor? Functor Adapter Algorithm String http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 13. String -STL내에 string클래스를 제공한다. -필요에 따라 크기가 늘어난다. :: 성능에 대한 고려 문자열 리터럴을 그대로 전달하는 과정의 복사 조심 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 14. String을 대신 할 수 있는 것들 Rope -표준이 아닌 템플릿 클래스-rope< type, allocator> -아주 긴 문자열을 하나의 단위로 작업 가능 (작은 문자 비효율적) CString -MFC STL과 호환 불가 Vector<char> -char 배열과 유사 -참조 카운팅 가능, CoW(Copy on Write) http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 15. Track :: 알고리즘과 고급 토픽 9장 |STL 고급 각 개체들의 효율적인 연결 방법 10장 | 추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 16. Track :: 알고리즘과 고급 토픽 9장 |STL 고급 각 개체들의 효율적인 연결 방법 10장 | 추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 17. Track :: 인터페이스? 격리 설계 팩토리 패턴 확장 10장 | 추상 인터페이스 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 18. Track :: 10장 | 추상 인터페이스 인터페이스? 격리 설계 팩토리 패턴 단점? http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 19. Interface 개념 -추상 인터페이스는 순수 가상 함수이다. -추상 인터페이스는 껍데기이다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 20. Track :: 10장 | 추상 인터페이스 인터페이스? 격리 설계 팩토리 패턴 단점? http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 21. Interface ::격리 설계 예제> 다중 플랫폼(OpenGL, DirectX)에 구애받지 않는 설계(층 분리) class IGraphicsRenderer { virtual void Redner(…)= 0; } class Renderer_D3D : public IGraphicsRenderer { virtual void Redner(…)= 0; } class Renderer_OGL : public IGraphicsRenderer { virtual void ~Redner(…)= 0; } IGraphicsRenderer* g_pRenderer= new GraphicsRendererOGL(); = new GraphicsRendererD3D(); http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 22. Track :: 10장 | 추상 인터페이스 인터페이스? 격리 설계 팩토리 패턴 단점? http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 23. Interface ::팩토리 패턴 격리 설계를 할 경우-> 헤더 파일의 크기 Interface 팩토리 패턴을 통한 완전한 분리 OGL D3D GraphicsRenderFactory GraphicsRenderFactory factory; IGraphicsRenderer* g_pRenderer; g_pRenderer = factory.CreateRenderer(“OGL”); g_pRenderer = factory.CreateRenderer(“D3D”); http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 24. Track :: 10장 | 추상 인터페이스 인터페이스? 격리 설계 팩토리 패턴 단점? http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 25. Interface ::단점 -코드의 복잡성 증가 -디버그가 어려워 진다. (추상 인터페이스형이 비어있는 경우) -가상 함수로 인한 성능 저하 -위와 같은 단점들이 해를 입히는 데미지보다추상 인터페이스 구현으로 인해 얻는 것들이 더 많기 때문에 적극적으로 활용 http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr
  • 26. 감사합니다. http://raimsoft.com DreamexecutionWarrock Client team Choi Jun Hyeok http://dreamexe.co.kr