Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Classes

NameDescription
Geo::GeoError

Description of a single error reported via an IGeoProgressProxy.

Geo::GeoProgress

Helper class to manage an IGeoProgressProxy.

Geo::IGeoProgressProxy

An interface for informing a client about the current progress of an operation.

Geo::TxtProgressBar

A simple implementation of an IGeoProgressProxy that uses printf to communicate with the user.

Functions

NameDescription
GeoAttachLogger(GeoLogHandler, eGeoLogMsgTypeMask)

Attach a log handler which will be passed messages of the requested types.

GeoDetachAllLoggers(eGeoLogMsgTypeMask)

Detach all log handlers for the specified message types.

GeoDetachLogger(GeoLogHandler, eGeoLogMsgTypeMask)

Detach a previously attached log handler, it if was previously attached.

GeoIsLoggerAttached(eGeoLogMsgTypeMask)

Return true if at least one logger is attached for all of the specified message types.

GeoLogHandler_Debugger(eGeoLogMsgType, u32, const char *)

A log message handler for writing messages to the debugger output channel.

GeoLogHandler_Popup(eGeoLogMsgType, u32, const char *)

A log message handler for displaying messages in a popup box.

GeoLogHandler_Stdout(eGeoLogMsgType, u32, const char *)

A log message handler for writing messages to stdout.

GeoLogHandler_Stdout_SetOrigin(const char *)

To support the MS error message format (see http://tinyurl.com/6hm53bz) allow user to set an Origin, otherwise just leave empty.

GeoLogMsgType(eGeoLogMsgType, u32, char *)

It is convenient to have a textual label for a given channel easily available.

GeoPrintf(eGeoLogMsgType, const char *, ...)

Messages are passed through the logger using a "printf()" like function.

GeoPrintf(eGeoLogMsgType, u32, const char *, ...)

Messages are passed through the logger using a "printf()" like function.

GeoStageBegin(const char *)

Begin a statistics block.

GeoStageEnd()

End a statistics block.

GeoStatistic(const char *, float)

Log a single statistic, as a name/value pair.

GeoStatistic(const char *, const char *)

Log a single statistic, as a name/value pair.

GeoStatistic(const char *, double)

Log a single statistic, as a name/value pair.

GeoStatistic(const char *, Geo::s64)

Log a single statistic, as a name/value pair.

GeoStatistic(const char *, Geo::s32)

Log a single statistic, as a name/value pair.

GeoStatistic(const char *, Geo::u32)

Log a single statistic, as a name/value pair.

GeoStatistic(const char *, Geo::u64)

Log a single statistic, as a name/value pair.

GeoStatisticsBegin(const char *, const char *, const char *)

Begin a StatusXml file.

GeoStatisticsEnd()

End the StatusXml file (note that you may wish to set the filename to NULL after this)

GeoStatusLogHandler_XmlFile(eGeoLogMsgType, u32, const char *)

The event handler for the StatusXml file.

GeoStatusLogHandler_XmlFile_SetName(const char *, bool)

Set the name of the StatusXml file writer. If not called, no file is created.

MakeGeoError(const char *, TPayload *)

Creates a GeoError struct by filling in the given error code, textual message and payload data.

MakeGeoError(const ErrorType &)

Creates a GeoError struct by filling in the given error code, textual message and payload data.

PrintError(const GeoError &)

Sends a GeoError object to the listeners attached to the GeoPrintf handlers.

StopAndEnterDebugger()

Drop into the debugger.

Enums

NameDescription
eGeoErrorSeverity

The severity of an error.

eGeoLogMsgType

enum eGeoLogMsgType

Typedefs

NameDescription
u8 eGeoLogMsgTypeMask

A bit mask containing one or more message type flags.

bool(* GeoLogHandler)(eGeoLogMsgType msgType, u32 code, const char *msgText)

A log handler is a function which gets called when messages are passed using GeoPrintf().

s8 GeoLogHandlerCount

An internal handler count variable; signed because -1 is used to indicate an empty handler list.

Variables

NameDescription
const GeoLogHandlerCount GEO_LOG_MAX_HANDLERS_PER_TYPE = 4

The maximum number of log handlers that can be installed per log message type.

const s32 GEO_LOG_MAX_MSG_LENGTH = 8192

Maximum length of a log message.

const s32 GEO_LOG_MSG_TYPE_MAX_LENGTH = 64

Minimum required buffer size needed for GeoLogMsgType().

const eGeoLogMsgType GEO_LOG_NUM_MSG_TYPE_INDEX[GEO_LOG_NUM_MSG_TYPES] = {LOG_INFO, LOG_DEBUG, LOG_STATUS, LOG_WARN, LOG_FATAL, LOG_ASSERT}

Define the order in which the message types are represented in internal data structures.

const u8 GEO_LOG_NUM_MSG_TYPES = 6

The number of types of log message.

const eGeoLogMsgTypeMask LOG_ALL = LOG_INFO | LOG_DEBUG | LOG_STATUS | LOG_WARN | LOG_FATAL | LOG_ASSERT

A bit mask for containing all the valid message types.

Defines

NameDescription
GEO_ASSERT (void)0

Assert Handling: Please use the GEO_ASSERT() or GEO_ASSERT_MSG() macros in code, rather than calling CheckAssert() or CheckAssertMsg() directly.

GEO_ASSERT_MSG (void)0

Same as GEO_ASSERT, but adds an additional message string to the output.

GEO_ASSERT_REINTERPRET_ARRAY_CAST_OK GEO_ASSERT(GEO_SUBCLASS_OFFSET(CLS, SUB) == 0)

Check that a reinterpret_cast from CLS* to/from SUB* doesn't change the address.

GEO_VERIFY a

Always execute code and (when asserts are enabled) ensure that the return value is as expected.


Anchor
af4f4663ba9dd315903bfc1b27d3bcb52
af4f4663ba9dd315903bfc1b27d3bcb52

bool Geo::GeoAttachLogger

...

public: bool GeoAttachLogger
(
    GeoLogHandler logHandler,
    eGeoLogMsgTypeMask typeMask
)

...

Attach a log handler which will be passed messages of the requested types.

It returns true if it was successfully registered for all message types, otherwise a warning message is raised, and it returns false.


Anchor
ae0c8018e25e93da19120aab187931dba
ae0c8018e25e93da19120aab187931dba

void Geo::GeoDetachAllLoggers

...

public: void GeoDetachAllLoggers
(
    eGeoLogMsgTypeMask typeMask
)

...

Detach all log handlers for the specified message types.


Anchor
a979618c9e76611b1fd5bdd40bdc50ccd
a979618c9e76611b1fd5bdd40bdc50ccd

bool Geo::GeoDetachLogger

...

public: bool GeoDetachLogger
(
    GeoLogHandler logHandler,
    eGeoLogMsgTypeMask typeMask
)

...

Detach a previously attached log handler, it if was previously attached.

Returns true it if was detached, and false otherwise.


Anchor
a0a7eeb5ce34cf7d8e19b90559bf00592
a0a7eeb5ce34cf7d8e19b90559bf00592

bool Geo::GeoIsLoggerAttached

...

public: bool GeoIsLoggerAttached
(
    eGeoLogMsgTypeMask typeMask
)

...

Return true if at least one logger is attached for all of the specified message types.


Anchor
ae129f2c1987ee9c722cc2a223f7a9a1f
ae129f2c1987ee9c722cc2a223f7a9a1f

bool Geo::GeoLogHandler_Debugger

...

public: bool GeoLogHandler_Debugger
(
    eGeoLogMsgType msgType,
    u32 code,
    const char * msgText
)

...

A log message handler for writing messages to the debugger output channel.


Anchor
abaa5891cf64646dbb3e69bf8d6c480dd
abaa5891cf64646dbb3e69bf8d6c480dd

bool Geo::GeoLogHandler_Popup

...

public: bool GeoLogHandler_Popup
(
    eGeoLogMsgType msgType,
    u32 code,
    const char * msgText
)

...

A log message handler for displaying messages in a popup box.


Anchor
a7c8559934b7812517f2b95610bc7bd82
a7c8559934b7812517f2b95610bc7bd82

bool Geo::GeoLogHandler_Stdout

...

public: bool GeoLogHandler_Stdout
(
    eGeoLogMsgType msgType,
    u32 code,
    const char * msgText
)

...

A log message handler for writing messages to stdout.


Anchor
ae82351f6b2f084048811b1e91d2fe9b9
ae82351f6b2f084048811b1e91d2fe9b9

void Geo::GeoLogHandler_Stdout_SetOrigin

...

public: void GeoLogHandler_Stdout_SetOrigin
(
    const char * filename
)

...

To support the MS error message format (see http://tinyurl.com/6hm53bz) allow user to set an Origin, otherwise just leave empty.


Anchor
a0cce4a4e3b38e1cb00152aba34998ffc
a0cce4a4e3b38e1cb00152aba34998ffc

void Geo::GeoLogMsgType

...

public: void GeoLogMsgType
(
    eGeoLogMsgType type,
    u32 code,
    char * buffer
)

...

It is convenient to have a textual label for a given channel easily available.

The given buffer must be at least as long as GEO_LOG_MSG_TYPE_MAX_LENGTH.


Anchor
a2f04f64e99fb5ba2ccb0a818258a4605
a2f04f64e99fb5ba2ccb0a818258a4605

bool Geo::GeoPrintf

...

public: bool GeoPrintf
(
    eGeoLogMsgType msgType,
    const char * fmtStr,
    ...
)

...

Messages are passed through the logger using a "printf()" like function.

This function will always return true, unless any of the registered handlers return false. This is useful, for instance in the assert handler, where returning false indicates that the debugger should be entered.


Anchor
ac1a2c519fc3bb6cff4865214e4094fe7
ac1a2c519fc3bb6cff4865214e4094fe7

bool Geo::GeoPrintf

...

public: bool GeoPrintf
(
    eGeoLogMsgType msgType,
    u32 code,
    const char * fmtStr,
    ...
)

...

Messages are passed through the logger using a "printf()" like function.

This function will always return true, unless any of the registered handlers return false. This is useful, for instance in the assert handler, where returning false indicates that the debugger should be entered.


Anchor
a3be44a98e7d1f6ef2a45d9b85746a0eb
a3be44a98e7d1f6ef2a45d9b85746a0eb

void GEO_CALL Geo::GeoStageBegin

...

public: void GEO_CALL GeoStageBegin
(
    const char * name
)

...

Begin a statistics block.


Anchor
a40a755f838fadd57b60ff0dd213ecb8b
a40a755f838fadd57b60ff0dd213ecb8b

void GEO_CALL Geo::GeoStageEnd

...

public: void GEO_CALL GeoStageEnd()

...

End a statistics block.


Anchor
ab3f1e525ef853fe8ccfa09fea8801a27
ab3f1e525ef853fe8ccfa09fea8801a27

void GEO_CALL Geo::GeoStatistic

...

public: void GEO_CALL GeoStatistic
(
    const char * name,
    float value
)

...

Log a single statistic, as a name/value pair.


Anchor
a4a5b54bfa893bd8bd7628ea7d4550b6f
a4a5b54bfa893bd8bd7628ea7d4550b6f

void GEO_CALL Geo::GeoStatistic

...

public: void GEO_CALL GeoStatistic
(
    const char * name,
    const char * value
)

...

Log a single statistic, as a name/value pair.


Anchor
a29e1ea12c6e634ab0b9cb91abb294153
a29e1ea12c6e634ab0b9cb91abb294153

void GEO_CALL Geo::GeoStatistic

...

public: void GEO_CALL GeoStatistic
(
    const char * name,
    double value
)

...

Log a single statistic, as a name/value pair.


Anchor
ae9f197c7d2124a5d474b0b66759d62cf
ae9f197c7d2124a5d474b0b66759d62cf

void GEO_CALL Geo::GeoStatistic

...

public: void GEO_CALL GeoStatistic
(
    const char * name,
    Geo::s64 value
)

...

Log a single statistic, as a name/value pair.


Anchor
ad4ecb22e8e3db647b3d59d679b3eeb2b
ad4ecb22e8e3db647b3d59d679b3eeb2b

void GEO_CALL Geo::GeoStatistic

...

public: void GEO_CALL GeoStatistic
(
    const char * name,
    Geo::s32 value
)

...

Log a single statistic, as a name/value pair.


Anchor
a081c8fa86e41650ec7213151f967ce2a
a081c8fa86e41650ec7213151f967ce2a

void GEO_CALL Geo::GeoStatistic

...

public: void GEO_CALL GeoStatistic
(
    const char * name,
    Geo::u32 value
)

...

Log a single statistic, as a name/value pair.


Anchor
af34e2f1e8ad438136bee371f408323ce
af34e2f1e8ad438136bee371f408323ce

void GEO_CALL Geo::GeoStatistic

...

public: void GEO_CALL GeoStatistic
(
    const char * name,
    Geo::u64 value
)

...

Log a single statistic, as a name/value pair.


Anchor
a8e256e86dd6b25ace288836fb0de6178
a8e256e86dd6b25ace288836fb0de6178

void GEO_CALL Geo::GeoStatisticsBegin

...

public: void GEO_CALL GeoStatisticsBegin
(
    const char * taskName,
    const char * output,
    const char * version
)

...

Begin a StatusXml file.


Anchor
a7568227fdecd39b3a51a09f253463deb
a7568227fdecd39b3a51a09f253463deb

void GEO_CALL Geo::GeoStatisticsEnd

...

public: void GEO_CALL GeoStatisticsEnd()

...

End the StatusXml file (note that you may wish to set the filename to NULL after this)


Anchor
adddbf3557994a7f464533cba1a7b175a
adddbf3557994a7f464533cba1a7b175a

bool GEO_CALL Geo::GeoStatusLogHandler_XmlFile

...

public: bool GEO_CALL GeoStatusLogHandler_XmlFile
(
    eGeoLogMsgType msgType,
    u32 code,
    const char * msgText
)

...

The event handler for the StatusXml file.


Anchor
aabeea264b8aa02776b84f954e0eb9feb
aabeea264b8aa02776b84f954e0eb9feb

void GEO_CALL Geo::GeoStatusLogHandler_XmlFile_SetName

...

public: void GEO_CALL GeoStatusLogHandler_XmlFile_SetName
(
    const char * filename,
    bool logInputOutput
)

...

Set the name of the StatusXml file writer. If not called, no file is created.


Anchor
aaf90b16d6e6589847d8d96a29698b760
aaf90b16d6e6589847d8d96a29698b760

GeoError Geo::MakeGeoError

...

public: GeoError MakeGeoError
(
    const char * message,
    TPayload * pPayload
)

...

Creates a GeoError struct by filling in the given error code, textual message and payload data.

The severity of the error is automatically set using the severity defined in the payload class.


Anchor
ab7d787592668c1cdc465b104e9cf5cf8
ab7d787592668c1cdc465b104e9cf5cf8

GeoError Geo::MakeGeoError

...

public: GeoError MakeGeoError
(
    const ErrorType & error
)

...

Creates a GeoError struct by filling in the given error code, textual message and payload data.

The severity of the error is automatically set using the severity defined in the error class.


Anchor
a2e78f00e78f3097c8ea82bd01431d99a
a2e78f00e78f3097c8ea82bd01431d99a

void Geo::PrintError

...

public: void PrintError
(
    const GeoError & error
)

...

Sends a GeoError object to the listeners attached to the GeoPrintf handlers.

This is the simplest response you can have to a GeoError being raised.


Anchor
a610d1de97a106fb7d04c6ce3604803f6
a610d1de97a106fb7d04c6ce3604803f6

void Geo::StopAndEnterDebugger

...

public: void StopAndEnterDebugger()

...

Drop into the debugger.


Anchor
a95d65c83e2d9541d56420d3dbfa4b286
a95d65c83e2d9541d56420d3dbfa4b286

eGeoErrorSeverity

...

public: enum eGeoErrorSeverity
{
    ES_WARNING = 0,
    ES_FATAL = 1
}

...

The severity of an error.

enumerators
ES_WARNING
ES_FATAL


Anchor
ab7feeef556bc67575108bd615cfd8fe7
ab7feeef556bc67575108bd615cfd8fe7

eGeoLogMsgType

...

public: enum eGeoLogMsgType
{
    LOG_INFO = 1,
    LOG_DEBUG = 2,
    LOG_STATUS = 4,
    LOG_WARN = 8,
    LOG_FATAL = 16,
    LOG_ASSERT = 32
}

...

enum eGeoLogMsgType

The message logger knows about different kinds of log message.

Messages are expected to be formatted for output, and in particular should contain trailing line feed characters ("\n") where necessary. It is up to a particular logger handler to translate these into the correct convention for it's use, for example replacing "\n" with "\r\n" when writing to Windows files.

Note: If you add new message remember to preinitialise the LastLogHandler[] array as this will be missed by the compiler! Note: These should be arranged in the order of the frequency at which each message type is expected to be generated, with more frequent first.

enumerators
LOG_INFO

General messages: general information, and other output messages.

LOG_DEBUG

Debug messages: specifically to aid development, usually stripped from release code.

LOG_STATUS

Status messages: specific formatting to enable later processing, used for timing/etc.

LOG_WARN

Warning messages: should be paid attention to, but the program usually continues.

LOG_FATAL

Critical messages: error messages, usually generated to indicate why the program cannot proceed.

LOG_ASSERT

Assert message text: caused by an assertion failure.