|
|
@@ -33,35 +33,6 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
|
namespace crown
|
|
|
{
|
|
|
|
|
|
-#define INVALID_ID 65535
|
|
|
-
|
|
|
-struct Id
|
|
|
-{
|
|
|
- uint16_t id;
|
|
|
- uint16_t index;
|
|
|
-
|
|
|
- void decode(uint32_t id_and_index)
|
|
|
- {
|
|
|
- id = (id_and_index & 0xFFFF0000) >> 16;
|
|
|
- index = id_and_index & 0xFFFF;
|
|
|
- }
|
|
|
-
|
|
|
- uint32_t encode() const
|
|
|
- {
|
|
|
- return (uint32_t(id) << 16) | uint32_t(index);
|
|
|
- }
|
|
|
-
|
|
|
- bool operator==(const Id& other)
|
|
|
- {
|
|
|
- return id == other.id && index == other.index;
|
|
|
- }
|
|
|
-
|
|
|
- bool operator!=(const Id& other)
|
|
|
- {
|
|
|
- return id != other.id || index != other.index;
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
/// Table of Ids.
|
|
|
template <uint32_t MAX_NUM_ID>
|
|
|
class IdTable
|