C4 Engine
C4 Engine API Documentation

class Reporter

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

class Reporter : public ListElement<Reporter>


Reporter(ReportCallback *callback, void *cookie = nullptr);

callback The callback function to invoke when a message is reported.
cookie The cookie that is passed to the report handler as its last parameter.
The Reporter class encapsulates a callback function 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 callback functions corresponding to all installed reporters are invoked. The ReportCallback type is defined as follows.

typedef void ReportCallback(const char *text, uint32 flags, void *cookie);

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