Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare the size of a numeric entity id #144

Merged
merged 1 commit into from
Feb 1, 2024
Merged

Declare the size of a numeric entity id #144

merged 1 commit into from
Feb 1, 2024

Conversation

huntc
Copy link
Collaborator

@huntc huntc commented Jan 30, 2024

Permits the number of bits to be used for describing an entity id to be declared explicitly, rather than assuming 32 bits. I found that using MAC addresses with 48 bits as entity ids is also useful, and still leaves plenty of bits for record types.

A const generic is used and so therefore there is no runtime penalty. I have included a runtime assertion to ensure that an entity id does not exceed the allocated number of bits.

This is a small breaking change and I have a PR pending for the sample.

@huntc huntc self-assigned this Jan 30, 2024
@huntc huntc added the enhancement New feature or request label Jan 30, 2024
Base automatically changed from persist-event-if to main February 1, 2024 07:35
Permits the number of bits to be used for describing an entity id to be declared explicitly, rather than assuming 32 bits. I found that storing MAC addresses with 48 bits is also useful, and still leaves plenty of bits for record types.

A const generic is used and so therefore there is no runtime penalty. I have included a runtime assertion to ensure that an entity id does not exceed the allocated number of bits.
Copy link
Member

@patriknw patriknw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@patriknw patriknw merged commit c574246 into main Feb 1, 2024
2 checks passed
@patriknw patriknw deleted the generic-bits branch February 1, 2024 07:41
@patriknw patriknw added this to the 0.8.0 milestone Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants