Multiple Inheritance Section 10'5 - PowerPoint PPT Presentation

About This Presentation
Title:

Multiple Inheritance Section 10'5

Description:

A compilation of material developed by Felix Hernandez-Campos and Mircea Nicolescu ... For gp-list_node view. adjust the student view by a compile-time constant d ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 15
Provided by: csU50
Learn more at: https://www.cs.unca.edu
Category:

less

Transcript and Presenter's Notes

Title: Multiple Inheritance Section 10'5


1
Multiple Inheritance(Section 10.5)
  • CSCI 431 Programming Languages
  • Fall 2003

A compilation of material developed by Felix
Hernandez-Campos and Mircea Nicolescu
2
Multiple Inheritance
3
Multiple Inheritance - Implementation
4
Multiple Inheritance - Implementation
5
Multiple Inheritance - Implementation
6
Multiple Inheritance - Implementation
7
Multiple Inheritance
8
Multiple Inheritance
9
Multiple Inheritance
10
Multiple Inheritance
gp_list_node person gp-list_node
\ / \ /
student professor \
/ student_prof
  • Repeated inheritance multiple inheritance where
    there are multiple paths to an ancestor
  • Types of repeated inheritance
  • replicated inheritance separate copies
    (gp_list_node)
  • shared inheritance single copy (person)
  • Eiffel by default shared inheritance
  • can get replicated inheritance of individual
    members by renaming them
  • C by default replicated inheritance
  • can get shared inheritance by labeling the
    inheritance as virtual

class professor public virtual person, public
gp_list_node ... class student public
virtual person, public gp_list_node ...
11
Replicated Inheritance
12
Shared Inheritance
13
Object-Oriented Languages
14
Object-Oriented Languages
Write a Comment
User Comments (0)
About PowerShow.com