2024-03-08 05:55:47 +00:00
|
|
|
#pragma once
|
2024-04-08 22:07:57 +00:00
|
|
|
///@file
|
2024-03-08 05:55:47 +00:00
|
|
|
|
|
|
|
#include <cinttypes>
|
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
|
|
|
class PosIdx
|
|
|
|
{
|
2024-01-29 05:19:23 +00:00
|
|
|
friend struct LazyPosAcessors;
|
2024-03-08 05:55:47 +00:00
|
|
|
friend class PosTable;
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint32_t id;
|
|
|
|
|
|
|
|
explicit PosIdx(uint32_t id)
|
|
|
|
: id(id)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
PosIdx()
|
|
|
|
: id(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit operator bool() const
|
|
|
|
{
|
|
|
|
return id > 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator<(const PosIdx other) const
|
|
|
|
{
|
|
|
|
return id < other.id;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator==(const PosIdx other) const
|
|
|
|
{
|
|
|
|
return id == other.id;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator!=(const PosIdx other) const
|
|
|
|
{
|
|
|
|
return id != other.id;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
inline PosIdx noPos = {};
|
|
|
|
|
|
|
|
}
|