Cover
Copyright and Credits
Dedication
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: Getting Started with C++
Rolling the dice
Understanding classes – the Car class
Extending the Car class
A class hierarchy – the Person, Student, and Employee classes
A simple data type – the stack
A more advanced data type – the queue
Summary
Chapter 2: Data Structures and Algorithms
The List class
The Cell class
The Iterator class
The List class
Adding a list to an existing list
Erasing a value from the list
The Set class
Union, intersection, and difference operations
Basic searching and sorting
The select sort algorithm
The insert sort algorithm
The bubble sort algorithm
The extended List class
The ReverseIterator class
The extended Set class
Union, intersection, and difference
Advanced searching and sorting
The merge sort algorithm
The quick sort algorithm
Summary
Chapter 3: Building a Library Management System
The Book class
Writing the book
Reading the book
Borrowing and reserving the book
Displaying the book
The Customer class
Reading the customer from a file
Writing the customer to a file
Borrowing and reserving a book
Displaying the customer
The Library class
Looking up books and customers
Adding a book
Deleting a book
Listing the books
Adding a customer
Deleting a customer
Listing the customers
Borrowing a book
Reserving a book
Returning a Book
Saving the library information to a file
Loading the library information from a file
The main function
Summary
Chapter 4: Library Management System with Pointers
The Book class
Reading and writing the book
Borrowing and reserving the book
Displaying the book
The Customer class
Reading and writing the customer
Borrowing and reserving a book
Displaying the customer
The Library class
Looking up books and customers
Adding a book
Deleting a book
Listing the books
Adding a customer
Deleting a customer
Listing the customers
Borrowing a book
Reserving a book
Returning a book
Looking up books and customers
Marshmallowing
Saving the library information to a file
Writing the book objects
Writing the customer objects
Writing the borrower index
Writing the reservation indexes
Writing the loan book indexes
Writing the reservation book indexes
Loading the library information from a file
Reading the book objects
Reading the customer objects
Reading the borrower index
Reading the reservation indexes
Reading the loan book indexes
Reading the reservation book indexes
Deallocating memory
The main function
Summary
Chapter 5: Qt Graphical Applications
Creating the clock application
Setting up the environment
The Clock class
The main function
Setting up reusable classes for windows and widgets
Adding a listener
The base window class
The base widget class
Building the drawing program
The Figure base class
The Line sub class
The Rectangle sub class
The Ellipse sub class
Drawing the window
Drawing the widget
The main function
Building an editor
The Caret class
Drawing the editor window
Drawing the editor widget
The main function
Summary
Chapter 6: Enhancing the Qt Graphical Applications
Improving the clock
The Clock class
The main function
Improving the drawing program
The Figure class
The Line class
The Rectangle class
The Ellipse class
The DrawingWindow class
The DrawingWidget class
The main function
Improving the editor
The EditorWindow class
The EditorWidget class
The main function
Summary
Chapter 7: The Games
Othello
The game widget
The OthelloWindow class
The OthelloWidget class
The main function
Noughts and crosses
The NaCWindow class
The NaCWidget class
The main function
Summary
Chapter 8: The Computer Plays
Othello
The OthelloWindow class
The OthelloWidget Class
The main function
Noughts and Crosses
The NaCWindow class
The NaCWidget class
The main function
Summary
Chapter 9: Domain-Specific Language
Introducing the source language – a simple example
The grammar of the source language
The target language
The colors
Error handling
The value
The scanner
Building the parser
Parsing the instructions of the language
Parsing the expressions of the language
Type checking the expression
Evaluating the values of the expressions
The viewer
The main function
Summary
Chapter 10: Advanced Domain-Specific Language
Improving the source language – an example
Improving the grammar
The Token and the Scanner
The parser
The evaluator
The main function
Summary
Other Books You May Enjoy
Index