System Utilities
C4Engine.h

class Reporter

The Reporter class handles messages passed to the system report chain.
Definition

class Reporter : public ListElement<Reporter>

Constructor

Reporter(ReportProc *proc, void *data = nullptr);

Parameters
proc The procedure to invoke when a message is reported.
data The data which is passed to the report procedure as its third parameter.
Description
The Reporter class encapsulates a procedure that is invoked when the Engine::Report function is called. Once an instance of the Reporter class has been constructed, it can be installed by calling the Engine::InstallReporter function.

When a message is reported, the procedures corresponding to all installed reporters are invoked. The ReportProc type is defined as follows.

typedef void ReportProc(const char *text, unsigned long flags, void *data);

The text and flags parameters passed to the procedure pointed to by the proc parameter match those passed to the Engine::Report function. The data parameter passed to the procedure pointed to by the proc parameter matches the data parameter passed to the constructor of the Reporter class.

A reporter is uninstalled by destroying its associated class instance.
Base Classes
ListElement<Reporter> Used internally to store all instances of Reporter in a list.