The ON_UuidList class provides a tool to efficiently maintain a list of uuids and determine if a uuid is in the list. This class is based on the premise that there are no duplicate uuids in the list.
More...
#include <opennurbs_array.h>
The ON_UuidList class provides a tool to efficiently maintain a list of uuids and determine if a uuid is in the list. This class is based on the premise that there are no duplicate uuids in the list.
◆ ON_UuidList() [1/3]
ON_UuidList::ON_UuidList |
( |
| ) |
|
◆ ON_UuidList() [2/3]
ON_UuidList::ON_UuidList |
( |
int |
capacity | ) |
|
◆ ~ON_UuidList()
ON_UuidList::~ON_UuidList |
( |
| ) |
|
◆ ON_UuidList() [3/3]
◆ AddUuid()
bool ON_UuidList::AddUuid |
( |
ON_UUID |
uuid, |
|
|
bool |
bCheckForDupicates = true |
|
) |
| |
Adds a uuid to the list.
- Parameters
-
uuid | [in] id to add. |
bCheckForDupicates | [in] if true, then the uuid is not added if it is already in the list. If you are certain that the uuid is not in the list and you are going to have a large list of uuids, then setting bCheckForDupicates=false will speed up the addition of uuids. |
- Returns
- True if uuid was added. False if uuid was not added because it is already in the collection.
◆ Array()
const ON_UUID* ON_UuidList::Array |
( |
| ) |
const |
◆ Compact()
void ON_UuidList::Compact |
( |
| ) |
|
Makes the uuid list as efficent as possible in both search speed and memory usage. Use Compact() when a uuid list will be in use but is not likely to be modifed. A list that has been compacted can still be modified.
◆ CompareUuid()
static int ON_UuidList::CompareUuid |
( |
const ON_UUID * |
a, |
|
|
const ON_UUID * |
b |
|
) |
| |
|
static |
Fast uuid compare. Not necessarily the same as ON_UuidCompare().
◆ Count()
int ON_UuidList::Count |
( |
| ) |
const |
- Returns
- Number of active uuids in the list.
◆ Destroy()
void ON_UuidList::Destroy |
( |
| ) |
|
Destroy list. If list will be reused, Empty() is more efficient.
◆ Empty()
void ON_UuidList::Empty |
( |
| ) |
|
Provides an efficient way to empty a list so that it can be used again.
◆ FindUuid()
bool ON_UuidList::FindUuid |
( |
ON_UUID |
uuid | ) |
const |
Determine if a uuid is in the list.
- Returns
- True if uuid is in the list.
◆ GetUuids()
Append the uuids in this class to uuid_list.
- Parameters
-
- Returns
- Number of uuids added to uuid_list.
◆ operator=()
◆ Read() [1/2]
Read the uuid list from an archive.
- Parameters
-
archive | [in] archive to read from. |
- Returns
- true if the read was successful.
◆ Read() [2/2]
Read the uuid list from an archive.
- Parameters
-
archive | [in] archive to read from. bool bSortAfterRead - [in] True if ids should be sorted after the read so future lookups will be fast. False if the state of the sorted/unsorted bits that existed at write time should be preserved. |
- Returns
- true if the read was successful.
◆ RemapUuids()
This tool is used in rare situations when the object ids stored in the uuid list need to be remapped.
- Parameters
-
◆ RemoveUuid()
bool ON_UuidList::RemoveUuid |
( |
ON_UUID |
uuid | ) |
|
Removes a uuid from the list.
- Parameters
-
- Returns
- True if uuid was in the list and was removed. False if uuid was not in the list.
◆ Reserve()
void ON_UuidList::Reserve |
( |
size_t |
capacity | ) |
|
◆ Write() [1/2]
Saves the uuid list in an archive.
- Parameters
-
archive | [in] archive to write to. |
- Returns
- true if write was successful.
◆ Write() [2/2]
bool ON_UuidList::Write |
( |
class ON_BinaryArchive & |
archive, |
|
|
bool |
bSortBeforeWrite |
|
) |
| const |
Saves the uuid list in an archive.
- Parameters
-
archive | [in] archive to write to. |
bSortBeforeWrite | [in] True if ids should be sorted before the write so future lookups will be fast. False if the current state of the sorted/unsorted bits should be preserved. |
- Returns
- true if write was successful.