liveBook · Manning

GraphReport

As explained in Object-Oriented Software Design in C++

A book-specific report class that totals baseball outs and hit types and produces a bar-chart report when the game ends.

GraphReport is an Observer that tracks baseball hit totals and produces a bar-chart-style game report. It subscribes to BaseballReporter during construction, then receives each event through update(). section 12.1.3

Observer-based game reporting

A BaseballReporter distributes generated events to every subscribed Observer. GraphReport processes each hit independently, while LogReport and TableReport produce different views from the same event stream. The tester creates all three reports before calling distribute_content(). section 12.1.3

How Object-Oriented Software Design in C++ covers it

How deep it goes
Defines subscription, counters, event retrieval, and report helpers, while omitting GraphReport's complete update and rendering bodies.
Examples
Demonstrates hit counters, bar-rendering helpers, generated Event objects, and concurrent LogReport and TableReport subscribers.
What it assumes
Assumes basic C++ classes and inheritance while demonstrating interfaces, callbacks, subscription, and polymorphic notification.
What you can do after
Build it from scratch as an Observer that subscribes to BaseballReporter and processes each baseball Event.
How it connects
Connects Observer, Subject, BaseballReporter, Event, and polymorphism through event publication and report updates.

This explainer was generated by Manning's knowledge graph from the text of Object-Oriented Software Design in C++. The section links point to the parts of the book it draws on.