1 / 6

Multipelt arv

Drawable. Persistent. position bitmap. storage_file_name object_id. draw() move(). save() restore(). Box. Circle. Line. length width. end_a end_b. center radius. Persistent_drawable. Multipelt arv. ios. format_state condition_state locale streambuf.

jela
Download Presentation

Multipelt arv

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Drawable Persistent position bitmap storage_file_name object_id draw() move() save() restore() Box Circle Line length width end_a end_b center radius Persistent_drawable Multipelt arv CD5250 OOP med C++ Mats Medin MDH/IDT

  2. ios format_state condition_state locale streambuf Multipelt arv: iostream (inte riktigt rätt) class ostream : public ios class istream : public ios ostream istream gcount xxx ifstream ofstream iostream yyy class iostream : public istream, public ostream fstream CD5250 OOP med C++ Mats Medin MDH/IDT

  3. format_state condition_state locale streambuf format_state condition_state locale streambuf format_state condition_state locale streambuf format_state condition_state locale streambuf gcount xxx xxx yyy gcount iostream object??? istream object ostream object över- klass- delen från ios över- klass- delen från ios från istream ostreams “egen” underklassbit istreams “egen” underklassbit från ostream Kompileringsfel - dock endast vid försök att accessa de dubblerade delarna! iostreams “egen” underklassbit CD5250 OOP med C++ Mats Medin MDH/IDT

  4. ios format_state condition_state locale streambuf Multipelt arv: iostream med virtual inheritance class ostream : virtual public ios class istream : virtual public ios ostream istream gcount xxx ifstream ofstream iostream yyy class iostream : public istream, public ostream fstream CD5250 OOP med C++ Mats Medin MDH/IDT

  5. format_state condition_state locale streambuf gcount xxx yyy iostreams “egen” underklassbit Virtual inheritance iostream object en enda ios-bit! virtuell basklass från istream från ostream CD5250 OOP med C++ Mats Medin MDH/IDT

  6. multipelt Konstruktor-destruktor och arv När ett objekt skapas sker följande: 1. Konstruktorn för ev. överklass anropas alltid först. 2. Konstruktorerna för den aktuella klassens datamedlemmar anropas 3. Satserna i den aktuella klassens konstruktor exekveras. i deriveringslistans turordning När ett objekt tas bort sker följande: 1. Satserna i den aktuella klassens destruktor exekveras. 2. Destruktorerna för den aktuella klassens datamedlemmar anropas 3. Destruktorn för ev. överklass anropas. baklänges enligt deriveringslistans turordning CD5250 OOP med C++ Mats Medin MDH/IDT

More Related