C++ PROGRAMMING, PATTERNS & PRACTICES

Course Outline:

Module 1: Basic structure of C++ programme:

Layout of a Executable file

  • Source file (.cpp)
  • Header files ( .h)
  • Object files (.obj)
  • Complie time v/s link time v/s Runtime
  • Preprocessor Definitions/ Compile time switches
  • Executable File Format
  •  

    Runtime memory layout of a application

  • Code Segment
  • Data Segment
  • Heap
  • Stack
  •  

    Library

  • Static link library v/s Dynamic link library
  • Creating a static link library
  • Creating a dynamic link library
  • C++ library Design
  •  

    Namespace

  • What is a namespace?
  • Using Namespace with Scope resolution
  • Using Namespace with The using directive
  • Using Namespace with The using declaration
  • Namespace Aliases
  • Unnamed Namespace
  • Namespace Composition
  • Selection
  • Resolving Potential Clash
  • Name spaces are open
  •  

    Module 2: Functions

    Function Internals

  • Function Stack Frame
  • Calling Conventions
  • Naming Conventions
  • Inline function
  • Function prototype
  • Recursive Function
  • Overloading Functions
  •  

    Parameters, Arguments & return value

  • Pass by value v/s Pass by ref
  • Unnamed Function Parameters
  • Default function Arguments
  • Variable Parameter List
  • Temporary objects
  •  

    Template Function

  • Template Function
  • Overloading vs Generic Function
  • Function Template Internals
  • Full Specialization
  • Partial Specialization
  • Library Design Issue
  •  

    Module 3: Object Model

    Object Model

  • Simple Object Model
  • Table driven object model
  • C++ object model
  • Class internals
  • Generic class
  • Class Template Full specialization
  • Class Template Partial specialization
  • Template Bloating
  •  

    Data Members

  • static data members
  • const data members & const_cast
  • static const data member
  • mutable data member
  • Instance data member
  •  

    Member Function

  • Instance function
  • Static function
  • Const function
  • Friend functions
  •  

    Function Pointers

  • Callbacks using Function Pointer
  • Synchronize v/s Asyncronize calls
  •  

    Container class

  • Creating Container Class
  • Iterator Pattern
  • Standard containers(vector, stack, list, map, deque, set, multimap, multiset)
  •  

    Module 4: Initialization & Clean up

    Object Initialization

  • Compiler Synthesized Constructor
  • Deep copy v/s Shallow copy
  • Overloaded constructor
  • Copy constructor
  • Explicit constructor
  • Copy Constructor v/s Assignment operator
  •  

    Initialization List

  • Initialization List
  • Order of Initialization
  • Initialization v/s Assignment
  • Default Arguments
  • Calling base class constructor
  •  

    Object Cleanup

  • Destructor
  • Compiler Synthesized Destructor
  • Preventing destroying object instance
  •  

    Patterns & Techniques for construction

  • Destroying instance in the constructor
  • Preventing object Instance
  • Preventing Stack based objects
  • Prototype Pattern
  •  

    Module 5: Dynamic Memory Management

    New operator

  • New vs malloc vs calloc
  • Handling bad_alloc exception
  • Using new with nothrow
  • Placement new
  • Overloading new operator
  •  

    Delete operator

  • Delete vs Free
  • Destroying objects on heap
  • Destroying array of objects
  •  

    Techniques for Memory Management

  • Preventing Heap based objects
  • Preventing Stack based objects
  • Identifying object is on Heap or Stack
  • Smart pointers
  •  

    Patterns for Memory Management

  • Reference Counting
  • Singleton pattern
  •  

    Module 6: Inheritance & Containment

    Techniques using containment

  • Containment
  • Friend class
  • Nested Class
  •  

    Techniques using Inheritance

  • Containment v/s Inheritance
  • Private v/s protected inheritance
  • Changing scope of base member in derived class
  • Derived class
  •  

    Module 7: Virtual
    Virtual functions

  • Virtual member function
  • Pure virtual function
  • Abstract class v/s Interface v/s Concrete class
  •  

    Virtual function Issues

  • Calling virtual function from constructor
  • Calling virtual function from destructor
  • Calling virtual function from non virtual member function
  • Object Slicing
  •  

    Virtual Internals

  • Virtual functions in Single Inheritance
  • Virtual functions in Multiple Inheritance
  • Virtual Inheritance
  •  

    Runtime Type Identification

  • typeid function
  • type_info object
  • dynamic_cast vs static_cast
  • reinterpret_cast
  • RTTI Internals
  • RTTI on non polymorphic types
  •  

    Techniques using Virtual functions

  • Virtual destructor
  • Virtual constructor using Prototype pattern
  • Non member virtual function
  • Dual dispatching
  •  

    Patterns using Virtual functions

  • Template Method
  • Bridge Pattern
  • Abstract Factory Pattern
  •  

    Module 8: Exception Handling
    Exception Handling

  • Resumption v/s Termination
  • Throwing exception
  • try block
  • catch block
  • multiple catch blocks
  • catch any block
  • set_terminate functions
  •  

    Exception Handling Issues

  • Order of catch blocks
  • Catching exception by value
  • Throwing exception in constructor
  • Throwing exception in destructor
  • auto_ptr
  •  

    Advanced Exception Handling

  • standard exceptions
  • creating custom exception class
  • Exception handling internals
  • Exception Handling Performance Issues
  •  

    Post Training Reading

  • C++ Primer by Lippman
  • Inside Objects by Lippman
  • C++ By Bjarne Stroustrup
  • C++ Bible by AL Stevens
  • Complete Reference by Herbert Schildt
  • Advanced C++ james coplin
  • Effective C++ Scott mayor
  • More Effective C++ Scott mayor
  • Effective STL Scott mayor
  • Design Patterns (GOF)
  •  

    Evaluation Criteria for the Training

  • Test will be conducted for all participants at the end of the training.
  • Monitoring of responses while the session is in progress, degree of interaction and Quality of doubts / questions raised is related to degree of training imbibed
  •  

    Duration:

  • 5 days
  •