bit tag data More...
#include <BitPage.hpp>
Public Member Functions | |
BitPage (int bits_per_ent, unsigned char init_val) | |
Initialize memory. More... | |
void | get_bits (int offset, int count, int bits_per_ent, unsigned char *data) const |
Get tag values. More... | |
void | set_bits (int offset, int count, int bits_per_ent, const unsigned char *data) |
Set tag values. More... | |
void | set_bits (int offset, int count, int bits_per_ent, unsigned char value) |
Set several tag values to the same value. More... | |
unsigned char | get_bits (int offset, int bits_per_ent) const |
Get tag value. More... | |
void | set_bits (int offset, int bits_per_ent, unsigned char data) |
Set tag value. More... | |
void | search (unsigned char value, int offset, int count, int bits_per_ent, Range &results, EntityHandle start) const |
Search stored values for specified value. More... | |
Private Attributes | |
char | byteArray [BitTag::PageSize] |
The actual array of bytes. More... | |
bit tag data
This class represents a fixed-size block of memory in which bit tag values are stored.
Definition at line 17 of file BitPage.hpp.
moab::BitPage::BitPage | ( | int | bits_per_ent, |
unsigned char | init_val | ||
) |
Initialize memory.
bits_per_ent | Number of bits in each tag value. MUST BE A POWER OF TWO. |
init_val | The lower bits_per_ent bits of this byte are used to initialize each tag value. |
Definition at line 22 of file BitPage.cpp.
References byteArray, and moab::BitTag::PageSize.
|
inline |
Get tag value.
Get one tag value.
offset | Offset into list of values, where a value of zero indicates the first tag value, a value of one indicates the second tag value, etc. NOTE: This is the value offset, not the bit offset. |
bits_per_ent | Number of bits composing each tag value. NOTE: Must be a power of two. |
Definition at line 127 of file BitPage.hpp.
References byteArray, and moab::BitTag::PageSize.
|
inline |
Get tag values.
Get 'count' tag values, beginning with the one at 'offset'.
offset | Offset into list of values, where a value of zero indicates the first tag value, a value of one indicates the second tag value, etc. NOTE: This is the value offset, not the bit offset. |
count | Number of consecutive tag values to get. |
bits_per_ent | Number of bits composing each tag value. NOTE: Must be a power of two. |
data | Memory into which to copy tag values. Each value is copied into a separate byte, such that the lower bits of the bit contain the tag value and any unused higher bits are zero. |
Definition at line 149 of file BitPage.hpp.
Referenced by search().
void moab::BitPage::search | ( | unsigned char | value, |
int | offset, | ||
int | count, | ||
int | bits_per_ent, | ||
Range & | results, | ||
EntityHandle | start | ||
) | const |
Search stored values for specified value.
Find the offsets n in the data at which the specified value occurs, and for each one insert 'start + n' into the passed Range.
value | The value to look for |
offset | The offset at which to begin searching |
count | The number of values to search |
bits_per_ent | Number of bits composing each tag value. |
results | Result list. |
start | The handle of the entity corresponding to the tag value stored at 'offset' |
Definition at line 9 of file BitPage.cpp.
References moab::Range::begin(), get_bits(), and moab::Range::insert().
|
inline |
Set tag value.
Set tag value.
offset | Offset into list of values, where a value of zero indicates the first tag value, a value of one indicates the second tag value, etc. NOTE: This is the value offset, not the bit offset. |
bits_per_ent | Number of bits composing each tag value. NOTE: Must be a power of two. |
value | The lower 'bits_per_ent' of this byte are used as the tag value. Any additional higher bits are ignored. |
Definition at line 138 of file BitPage.hpp.
References byteArray, and moab::BitTag::PageSize.
|
inline |
Set tag values.
Set 'count' tag values, beginning with the one at 'offset'.
offset | Offset into list of values, where a value of zero indicates the first tag value, a value of one indicates the second tag value, etc. NOTE: This is the value offset, not the bit offset. |
count | Number of consecutive tag values to set. |
bits_per_ent | Number of bits composing each tag value. NOTE: Must be a power of two. |
data | Memory from which to copy tag values. Each value is copied from a separate byte. The lower 'bits_per_ent' of each byte are used as the tag value. Any additional higher bits are ignored. |
Definition at line 156 of file BitPage.hpp.
Referenced by set_bits().
|
inline |
Set several tag values to the same value.
Set 'count' tag values to specified value.
offset | Offset into list of values, where a value of zero indicates the first tag value, a value of one indicates the second tag value, etc. NOTE: This is the value offset, not the bit offset. |
count | Number of consecutive tag values to set. |
bits_per_ent | Number of bits composing each tag value. NOTE: Must be a power of two. |
value | The lower 'bits_per_ent' of this byte are used as the tag value. Any additional higher bits are ignored. |
Definition at line 163 of file BitPage.hpp.
References set_bits().
|
private |
The actual array of bytes.
Definition at line 124 of file BitPage.hpp.
Referenced by BitPage(), get_bits(), and set_bits().