Enumerations within structures?
Posted: Sun Sep 28, 2025 11:19 am
I am attempting to set up a list whose elements are in the format of a Structure, but the Structure elements are simply a sequence of bits (for ultrafast bitflag checking), and there are 32 bits. So in other words, the list is composed of a series of 32-bit elements, meaning they are ultimately just a list of 4-byte sequences, to be parsed by code for their set bits.
I'd like to set up a Structure so i can use the code to quickly find the value of the bit im looking at and reduce the parsing code. Can i use EnumerationBinary within a Structure to define each bit, or does that have to be outside of the Structure and used by the bit-parsing code. I know i can just set up a single-byte element within the structure for each bit, but i expect there to be tens of thousands of elements in the list, and i'd like to reduce the amount of memory each boolean will occupy. In other words, i dont want to use 1 whole byte for a 1-bit piece of data — i'd rather use a parser on a compression of bits.
If i cant use binary enumerations inside a structure, what is the best way to set up a series of 32 bitflags in each line of a list?
I hope all this makes sense, but if you need more explanation, i can provide a clearer intention. I have not begun doing the code, but i am setting up my data structures, unsure of what i can and cant do with Structure design
I'd like to set up a Structure so i can use the code to quickly find the value of the bit im looking at and reduce the parsing code. Can i use EnumerationBinary within a Structure to define each bit, or does that have to be outside of the Structure and used by the bit-parsing code. I know i can just set up a single-byte element within the structure for each bit, but i expect there to be tens of thousands of elements in the list, and i'd like to reduce the amount of memory each boolean will occupy. In other words, i dont want to use 1 whole byte for a 1-bit piece of data — i'd rather use a parser on a compression of bits.
If i cant use binary enumerations inside a structure, what is the best way to set up a series of 32 bitflags in each line of a list?
I hope all this makes sense, but if you need more explanation, i can provide a clearer intention. I have not begun doing the code, but i am setting up my data structures, unsure of what i can and cant do with Structure design