E D R , A S I H C RSS

Full text search for "NLComponent"

NL Component


Search BackLinks only
Display context of search results
Case-sensitive searching
  • MoreEffectiveC++/Techniques1of3 . . . . 20 matches
         class NLComponent{ // News Letter 의 부모 인자
         class TextBlock:public NLComponent{ // 글을 표현하는 인자
         class Graphic:public NLComponent{ // 그림을 표현하는 인자
          list<NLComponent*> components; // 글과 그림 인자의 저장소
          static NLComponent * readComponent(istream& str);
         class NLComponent{
          virtual NLComponent * clone() const = 0;
         class TextBlock: public NLComponent{
         class Graphic:public NLComponent{
         보다시피 클래스의 가상 복사 생성자는 실제 복사 생성자를 호출한다. 그러므로 "복사" 의미로는 일반 복사 생성자와 수행 기능이 같다 하지만 다른 점은 만들어진 객체마다 제각각의 알맞는 복사 생성자를 만든다는 점이 다르다. 이런 clone이 NewsLetter 복사 생성자를 만들때 NLComponent들을 복사하는데 기여를 한다. 어떻게 더 쉬운 작업이 되는지 다음 예제를 보면 이해 할수 있을 것이다.
          list<NLComponent *> components;
          for (list<NLComponent*>::constiterator it = rhs.components.begin();
         생성자는 실제로 가상 함수가 될수 없다. 마찬가지로 비멤버 함수들 역시 마찬가지 이리라, 하지만 그러한 기능이 필요할 떄가 있다. 바로 앞 예제에서 NLComponent와 그것에서 유도된 클래스들을 예를 들어 보자면 이들을 operator<<으로 출력을 필요로 할때 이리라. 뭐 다음과 같이 하면 문제 없다.
         class NLComponent{
         class TextBlock:public NLComponent{
         class Graphic:public NLComponent{
         class NLComponent {
         class TextBlock: public NLComponent {
         class Graphic: public NLComponent {
         ostream& operator<<(ostream& s, const NLComponent& c)
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.3761 sec