E D R , A S I H C RSS

Full text search for "NewsLetter"

News Letter


Search BackLinks only
Display context of search results
Case-sensitive searching
  • MoreEffectiveC++/Techniques1of3 . . . . 19 matches
         사실 가상 생성자라는건 존재하지 않는다. 하지만 이를 비슷하게 구현하는 것이다. 예를들자면 당신이 newsletter을 보내는 어플리케이션을 짜는데, 여기에 글과 그림 데이터 인자로 구성시킨다고 가정하면 이렇게 만들수 있을 것이다.
         class NewsLetter { // 글과, 그림을 가지는 News Letter
         NewsLetter 객체는 아마 디스크에서 자료를 적재할 것이다. NewsLetter가 디스크에서 자료를 가지고 보여주기 위해 istream을 사용해서 NewsLetter를 구성할 객체들을 생성한다고 가정한다면 다음과 같은 코드들을 대강 만들수 있는데
         class NewsLetter {
          NewsLetter(istream& str);
         NewsLetter::NewsLetter(istream& str)
          newsletter의 인자중 리스트인 components에 만든 객체를 넣는다.
         class NewsLetter{
         NewsLetter::NewsLetter(istream& str)
          // readComponent가 해석한 객체를 newsletter의 리스트 마지막에 추가시키는 과정
         보다시피 클래스의 가상 복사 생성자는 실제 복사 생성자를 호출한다. 그러므로 "복사" 의미로는 일반 복사 생성자와 수행 기능이 같다 하지만 다른 점은 만들어진 객체마다 제각각의 알맞는 복사 생성자를 만든다는 점이 다르다. 이런 clone이 NewsLetter 복사 생성자를 만들때 NLComponent들을 복사하는데 기여를 한다. 어떻게 더 쉬운 작업이 되는지 다음 예제를 보면 이해 할수 있을 것이다.
         class NewsLetter{
          NewsLetter(const NewsLetter* rhs); // NewsLetter의 복사 생성자
         NewsLetter::NewsLetter(const NewsLetter* rhs)
Found 1 matching page out of 7540 total pages (5000 pages are searched)

You can also click here to search title.

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
Processing time 0.2782 sec