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) | |
Runtime validation for indexing operations (debug builds only)
Catches common indexing mistakes during development:
Compiled out in release builds (zero runtime cost).
Usage:
Definition at line 277 of file IndexTypes.h.
|
inlineexplicit |
Construct validator with reference to mapper.
Definition at line 283 of file IndexTypes.h.
|
inline |
Validate that a position is within bounds.
| value | Position value to validate |
| context | Context string for error message (e.g., function name) |
| std::runtime_error | if position is out of range |
Definition at line 293 of file IndexTypes.h.
|
inline |
Warn if value looks like UUID but used as position (heuristic)
| value | Value to check |
| context | Context 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.