1.3.64
 
Loading...
Searching...
No Matches
helios::IndexValidator Class Reference

Runtime validation for indexing operations (debug builds only) More...

#include <IndexTypes.h>

Public Member Functions

 IndexValidator (const UUIDPositionMapper *mapper)
 Construct validator with reference to mapper.
 
void validatePosition (size_t value, const char *context) const
 Validate that a position is within bounds.
 
void warnPossibleMixup (size_t value, const char *context) const
 Warn if value looks like UUID but used as position (heuristic)
 

Detailed Description

Runtime validation for indexing operations (debug builds only)

Catches common indexing mistakes during development:

  • Position out of bounds
  • UUID used where position expected (heuristic warning)
  • Invalid UUID

Compiled out in release builds (zero runtime cost).

Usage:

IndexValidator validator(&mapper);
validator.validatePosition(pos.value, "myFunction");

Definition at line 277 of file IndexTypes.h.

Constructor & Destructor Documentation

◆ IndexValidator()

helios::IndexValidator::IndexValidator ( const UUIDPositionMapper mapper)
inlineexplicit

Construct validator with reference to mapper.

Definition at line 283 of file IndexTypes.h.

Member Function Documentation

◆ validatePosition()

void helios::IndexValidator::validatePosition ( size_t  value,
const char *  context 
) const
inline

Validate that a position is within bounds.

Parameters
valuePosition value to validate
contextContext string for error message (e.g., function name)
Exceptions
std::runtime_errorif position is out of range

Definition at line 293 of file IndexTypes.h.

◆ warnPossibleMixup()

void helios::IndexValidator::warnPossibleMixup ( size_t  value,
const char *  context 
) const
inline

Warn if value looks like UUID but used as position (heuristic)

Parameters
valueValue to check
contextContext string for warning message

Heuristic: If value >= primitive_count but is a valid UUID, warn that it might be a UUID/position mixup.

Definition at line 308 of file IndexTypes.h.


The documentation for this class was generated from the following file: