Derived Classes 2 - UAH CPE 212 Fundamentals of Software...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
UAH CPE 212 Fundamentals of Software Engineering Agenda Class 7 Derived Classes 2 Derived Classes 2 Key Concepts
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
UAH CPE 212 Today Last Time Derived Classes 1 This Time Derived Classes 2
Background image of page 2
UAH CPE 212 Review Derived Classes Defines a new class with some properties of the base class declare with public, protected or private derivation Default for class is private, default for struct is public Single and multiple inheritance Can be template or non-template Can have abstract base classes (never instantiated alone) Member functions Same name and signature in derived classes override the function behavior virtual functions behave as the type of the object not the type of a pointer Construction and destruction Base class constructor invoked from the derived class before executing the derived class. Derived class destructor executed then base class destructor. Cannot inherit friends Constructors and destructors Assignment operators Hidden member functions
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CPE 212 ADT Inheritance template <class Item> class List { public: // CONSTRUCTORS and DESTRUCTOR List( ); List(const List& source); ~List( ); // MODIFICATION MEMBER FUNCTIONS void start( ); void advance( ); void insert(const Item& entry); void attach(const Item& entry); void remove_current( ); void operator =(const List& source); // CONSTANT MEMBER FUNCTIONS size_t size( ) const { return many_nodes; } int is_item( ) const { return (cursor != NULL); } Item current( ) const; private: Node<Item> *head_ptr; Node<Item> *tail_ptr; Node<Item> *cursor;
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/09/2008 for the course CPE 212 taught by Professor Skipper during the Spring '07 term at University of Alabama in Huntsville.

Page1 / 12

Derived Classes 2 - UAH CPE 212 Fundamentals of Software...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online