HDK
|
#include <UN_Include.h>
Public Member Functions | |
UN_DataIDRemap ()=default | |
Default constructor. More... | |
UN_DataIDRemap (UN_DataID old_id_end, UN_DataID new_id_start, bool combine_id_zero=false) | |
UN_DataID | newStartOffset () const |
UN_DataID | oldEndOffset () const |
Returns the limit for the old IDs source range. More... | |
UN_DataSize | size () const |
Returns the number of IDs reserved by this merge map. More... | |
operator bool () const | |
UN_DataID | operator[] (UN_DataID old_id) const |
UN_DataID | nextDataID () const |
Returns the data ID that should be used for the data created next time. More... | |
Static Public Member Functions | |
static UN_DataID | remapIDFromOffsets (UN_DataID old_id, UN_DataID old_offset, UN_DataID new_offset) |
Class that remaps data IDs. Eg, between merged data conainers, like UN_NodeData. It's a lightweight object representing a mapping of old IDs to new ones. NOTE: Assumes the underlying mapping is representable as a constant shift. However it has a few range checks for consistency.
Definition at line 325 of file UN_Include.h.
|
default |
Default constructor.
|
inline |
Convenience constructor. old_id_end
- the limit on the original IDs in the source. Used for rudimentary range checks. new_id_start
- the base destination ID at which the entries copied from the source begin their new IDs in the destination. If combine_id_zero
is true, the data for the ID zero is not mapped to a brand new data slot, but is remapped to an existing ID of zero. Some data containers use ID of zero for a special entry that is treated differently than the other ones. Notably, the node data container uses ID of zero for the root node, and the root node from the src should not become a regular node in dest. Instead, src root ID maps to dst root ID and their data is combined.
Definition at line 343 of file UN_Include.h.
|
inline |
Returns the start offset for the destination ID range. I.e. the ID which source ID zero would be mapped to. Can be used with remapIdFromOffsets to map between ID sets with identical structure.
Definition at line 355 of file UN_Include.h.
|
inline |
Returns the data ID that should be used for the data created next time.
Definition at line 389 of file UN_Include.h.
|
inline |
Returns the limit for the old IDs source range.
Definition at line 359 of file UN_Include.h.
|
inlineexplicit |
Return true
if the mergemap was constructed with a valid newStartOffset()
. Default-constructed instances will return false
.
Definition at line 369 of file UN_Include.h.
Returns the new ID corresponding to the old
ID, if the old
ID is an ID contained within the source ID range; otherwise, returns an invalid ID.
Definition at line 375 of file UN_Include.h.
|
inlinestatic |
Let O be some object in an ID set S. If S is remapped multiple times at offsets A and B, with I being its ID within A, then {remapIdFromOffsets(I, A, B)} will return the ID of O within the remapping starting at B. If these conditions are not met, an undefined ID is returned.
Definition at line 401 of file UN_Include.h.
|
inline |
Returns the number of IDs reserved by this merge map.
Definition at line 363 of file UN_Include.h.