C4 Engine Terathon Software C4 Engine API Documentation

• System Utilities

API Links
Developer Links

class Reporter

Defined in:  C4Engine.h
The Reporter class handles messages passed to the system report chain.
Definition

class Reporter : public ListElement<Reporter>

Constructor

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

Parameters
proc The procedure to invoke when a message is reported.
cookie The cookie that is passed to the report procedure as its last 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_int32 flags, void *cookie);

The text and flags parameters passed to the procedure pointed to by the proc parameter match those passed to the Engine::Report function. The cookie parameter passed to the procedure pointed to by the proc parameter matches the cookie 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.