oa::Validation

— global validation controller

Static Public Methods

static void oa::Validation::dumpCounters(oa::LogComponent inComp = oa::LogComponent::Core)
static void oa::Validation::enable(bool inEnable = true)
static oa::U64 oa::Validation::getCounter(const char * inName)
static ValidationSeverity oa::Validation::getMinSeverity()
static void oa::Validation::incrCounter(const char * inName)
static void oa::Validation::incrCounterNamed(const char * inName)
static void oa::Validation::initFromEnv()
static bool oa::Validation::isEnabled()
static oa::Status oa::Validation::report(ValidationSeverity inSev, oa::LogComponent inComp, const char * inFmt)
static void oa::Validation::resetCounters()
static void oa::Validation::setCallback(Callback inCb)
static void oa::Validation::setMinSeverity(ValidationSeverity inSev)

Public Method Documentation

static void oa::Validation::dumpCounters( oa::LogComponent inComp = oa::LogComponent::Core )
log all non-zero counters at Debug level.

Parameters

inComp
oa::LogComponent

Default: oa::LogComponent::Core

Returns

void

The declared return value.

static void oa::Validation::enable( bool inEnable = true )
Enable / disable. Debug: on by default. release (OA_ENABLE_VALIDATION): off by default. call initFromEnv() once at startup to apply OA_VALIDATION / OA_VALIDATION_SEVERITY.

Parameters

inEnable
bool

Default: true

Returns

void

The declared return value.

static oa::U64 oa::Validation::getCounter( const char * inName )
Returns current counter value (0 if never incremented or in release).

Parameters

inName
const char *

Returns

oa::U64

The declared return value.

static ValidationSeverity oa::Validation::getMinSeverity()
No public source comment is attached to this declaration.

Returns

ValidationSeverity

The declared return value.

static void oa::Validation::incrCounter( const char * inName )
Increment a named counter (thread-safe, lock-free on the hot path).

Parameters

inName
const char *

Returns

void

The declared return value.

static void oa::Validation::incrCounterNamed( const char * inName )
Increment using a runtime string variable (for kernel names, etc.).

Parameters

inName
const char *

Returns

void

The declared return value.

static void oa::Validation::initFromEnv()
Read OA_VALIDATION and OA_VALIDATION_SEVERITY from the process environment. call once before any OA_VALIDATE macro fires (e.g. Engine::create).

Returns

void

The declared return value.

static bool oa::Validation::isEnabled()
No public source comment is attached to this declaration.

Returns

bool

The declared return value.

static oa::Status oa::Validation::report( ValidationSeverity inSev, oa::LogComponent inComp, const char * inFmt )
Internal: called by OA_VALIDATE macros. Formats message, calls callback. Returns oa::Status::error on Error/Fatal severity; ok on lower severity.

Parameters

inSev
ValidationSeverity

inComp
oa::LogComponent

inFmt
const char *

Returns

oa::Status

The declared return value.

static void oa::Validation::resetCounters()
reset all counters to 0.

Returns

void

The declared return value.

static void oa::Validation::setCallback( Callback inCb )
Optional custom callback; default writes via oa::Log*.

Parameters

inCb
Callback

Returns

void

The declared return value.

static void oa::Validation::setMinSeverity( ValidationSeverity inSev )
Override severity filter (default: Verbose in debug, warning in release).

Parameters

inSev
ValidationSeverity

Returns

void

The declared return value.