C/C++ For Linux <ul><ul><li>Session 8 </li></ul></ul><ul><ul><li>C++ - Session 2 </li></ul></ul>
Outline <ul><li>Automake example </li></ul><ul><li>More on OO in C++ (Classes Cont'd) </li></ul><ul><li>ISA in C++ - Inher...
Automake example <ul><li>Write your code </li></ul><ul><li>Makefile.am </li></ul><ul><ul><li>SUBDIRS </li></ul></ul><ul><u...
Automake example-cont'd <ul><li>Modify output </li></ul><ul><ul><li>Rename to configure.ac </li></ul></ul><ul><ul><li>AM_I...
Operator Overloading <ul><li>Why?  </li></ul><ul><ul><li>New behavior for a new type </li></ul></ul><ul><ul><li>Some use c...
Some new operators <ul><li>Stream operators </li></ul><ul><ul><li><<, >> </li></ul></ul><ul><ul><li>iostream, cin, and cou...
Exceptions <ul><li>OO error handling </li></ul><ul><li>Syntax: try, throw, catch </li></ul><ul><li>What happens? </li></ul...
Friends <ul><li>Access to private data </li></ul><ul><li>Friend functions/classes </li></ul><ul><li>Use and abuse of frien...
Inheritance <ul><li>ISA in C++ </li></ul><ul><li>Base Class – Derived Classes </li></ul><ul><li>Inheritance hierarchy – tr...
More Data Hiding <ul><li>Types </li></ul><ul><ul><li>Public, Private, Protected </li></ul></ul><ul><li>Role of protected <...
The ISA <ul><li>Construction </li></ul><ul><li>this is a base and is a derived </li></ul><ul><ul><li>External access to pu...
Multiple Inheritance <ul><li>Why? </li></ul><ul><li>Syntax </li></ul><ul><li>Diamond Shape </li></ul>
Polymorphism <ul><li>Pointers to base and derived </li></ul><ul><li>virtual methods </li></ul><ul><li>Pure virtual methods...
Interface <ul><li>Abstract vs Concrete </li></ul><ul><li>Use of private inheritance </li></ul><ul><li>Multiple Inheritance...
Next Session <ul><li>Some design patterns </li></ul><ul><li>A design problem </li></ul><ul><ul><li>Some device(s) has no n...
Upcoming SlideShare
Loading in...5
×

Sysprog 8

603

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
603
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Sysprog 8

  1. 1. C/C++ For Linux <ul><ul><li>Session 8 </li></ul></ul><ul><ul><li>C++ - Session 2 </li></ul></ul>
  2. 2. Outline <ul><li>Automake example </li></ul><ul><li>More on OO in C++ (Classes Cont'd) </li></ul><ul><li>ISA in C++ - Inheritance </li></ul><ul><li>Polymorphism </li></ul><ul><li>Next session </li></ul>
  3. 3. Automake example <ul><li>Write your code </li></ul><ul><li>Makefile.am </li></ul><ul><ul><li>SUBDIRS </li></ul></ul><ul><ul><li>Building Libraries </li></ul></ul><ul><ul><li>Building executables </li></ul></ul><ul><ul><ul><li>Linking against your library </li></ul></ul></ul><ul><ul><ul><li>Including your headers </li></ul></ul></ul><ul><li>autoscan </li></ul>
  4. 4. Automake example-cont'd <ul><li>Modify output </li></ul><ul><ul><li>Rename to configure.ac </li></ul></ul><ul><ul><li>AM_INIT_AUTOMAKE </li></ul></ul><ul><ul><li>AC_PROG_LIBTOOL </li></ul></ul><ul><li>autoreconf --install </li></ul><ul><li>./configure </li></ul><ul><li>Make </li></ul>
  5. 5. Operator Overloading <ul><li>Why? </li></ul><ul><ul><li>New behavior for a new type </li></ul></ul><ul><ul><li>Some use cases: assignment, addition, subscript. </li></ul></ul><ul><li>Syntax </li></ul><ul><ul><li>Within class (this) </li></ul></ul><ul><ul><li>Outside (to be continued) </li></ul></ul>
  6. 6. Some new operators <ul><li>Stream operators </li></ul><ul><ul><li><<, >> </li></ul></ul><ul><ul><li>iostream, cin, and cout </li></ul></ul><ul><li>new and delete </li></ul><ul><ul><li>Overloading </li></ul></ul>
  7. 7. Exceptions <ul><li>OO error handling </li></ul><ul><li>Syntax: try, throw, catch </li></ul><ul><li>What happens? </li></ul><ul><li>-fexceptions/-fno-exceptions </li></ul><ul><li>stdexcept logic_error </li></ul><ul><li>Mixed environment: structural/OO </li></ul><ul><li>Unhandled exceptions in Linux </li></ul>
  8. 8. Friends <ul><li>Access to private data </li></ul><ul><li>Friend functions/classes </li></ul><ul><li>Use and abuse of friends </li></ul><ul><li>Friend operator overloading </li></ul>
  9. 9. Inheritance <ul><li>ISA in C++ </li></ul><ul><li>Base Class – Derived Classes </li></ul><ul><li>Inheritance hierarchy – tree </li></ul>
  10. 10. More Data Hiding <ul><li>Types </li></ul><ul><ul><li>Public, Private, Protected </li></ul></ul><ul><li>Role of protected </li></ul><ul><li>Syntax </li></ul><ul><li>To be continued </li></ul>
  11. 11. The ISA <ul><li>Construction </li></ul><ul><li>this is a base and is a derived </li></ul><ul><ul><li>External access to public base class members </li></ul></ul><ul><ul><li>access to base method </li></ul></ul><ul><li>Method Overriding </li></ul><ul><ul><li>Same signature (vs overloading) </li></ul></ul>
  12. 12. Multiple Inheritance <ul><li>Why? </li></ul><ul><li>Syntax </li></ul><ul><li>Diamond Shape </li></ul>
  13. 13. Polymorphism <ul><li>Pointers to base and derived </li></ul><ul><li>virtual methods </li></ul><ul><li>Pure virtual methods </li></ul>
  14. 14. Interface <ul><li>Abstract vs Concrete </li></ul><ul><li>Use of private inheritance </li></ul><ul><li>Multiple Inheritance </li></ul><ul><li>In design patterns: </li></ul><ul><ul><li>Factory </li></ul></ul><ul><ul><li>Strategy – in IPC e.g. </li></ul></ul>
  15. 15. Next Session <ul><li>Some design patterns </li></ul><ul><li>A design problem </li></ul><ul><ul><li>Some device(s) has no nvram for settings </li></ul></ul><ul><ul><li>A program that always syncs it and is used to manage it </li></ul></ul><ul><ul><ul><li>Underlying interface to device can change </li></ul></ul></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×