The ON_UuidList class provides a tool to efficiently maintain a list of uuid-index pairs 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 uuid-index pairs 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_UuidIndexList() [1/3]
ON_UuidIndexList::ON_UuidIndexList |
( |
| ) |
|
|
default |
◆ ON_UuidIndexList() [2/3]
ON_UuidIndexList::ON_UuidIndexList |
( |
size_t |
capacity | ) |
|
◆ ~ON_UuidIndexList()
ON_UuidIndexList::~ON_UuidIndexList |
( |
| ) |
|
|
default |
◆ ON_UuidIndexList() [3/3]
◆ AddUuidIndex()
bool ON_UuidIndexList::AddUuidIndex |
( |
ON_UUID |
uuid, |
|
|
int |
index, |
|
|
bool |
bCheckForDupicates = true |
|
) |
| |
Adds a uuid-index pair to the list.
- Parameters
-
uuid | [in] id to add. This uuid cannot be ON_max_uuid because ON_max_uuid is |
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 have a have a large collection 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.
◆ Count()
unsigned int ON_UuidIndexList::Count |
( |
| ) |
const |
- Returns
- Number of active uuids in the list.
◆ FindUuid() [1/2]
bool ON_UuidIndexList::FindUuid |
( |
ON_UUID |
uuid | ) |
const |
Determine if an element with a uuid is in the list.
- Parameters
-
index | [out] if not nullptr and a matching uuid is found, then *index is set to the value of the index. |
- Returns
- True if an element was found. Returns false if the uuid is not in the list.
◆ FindUuid() [2/2]
bool ON_UuidIndexList::FindUuid |
( |
ON_UUID |
uuid, |
|
|
int * |
index |
|
) |
| const |
◆ FindUuidIndex()
bool ON_UuidIndexList::FindUuidIndex |
( |
ON_UUID |
uuid, |
|
|
int |
index |
|
) |
| const |
Determine if a uuid-index pair is in the list.
- Returns
- True if the uuid-index pair is in the list. Returns false if the uuid-index pair is not in the list.
◆ GetUuids()
Append the uuids in this class to uuid_list.
- Parameters
-
- Returns
- Number of uuids added to uuid_list.
◆ ImproveSearchSpeed()
void ON_UuidIndexList::ImproveSearchSpeed |
( |
| ) |
|
If you will perform lots of searches before the next change to the list, then calling ImproveSearchSpeed() will speed up the searches by culling removed objects and completely sorting the list so only a binary search is required. You may edit the list at any time after calling ImproveSearchSpeed(). If you are performing a few searches between edits, then excessive calling of ImproveSearchSpeed() may actually decrease overall program performance.
◆ operator=()
◆ RemoveAll()
void ON_UuidIndexList::RemoveAll |
( |
| ) |
|
Provides an efficient way to empty a list so that it can be used again.
◆ RemoveUuid()
bool ON_UuidIndexList::RemoveUuid |
( |
ON_UUID |
uuid | ) |
|
Removes an element with a matching uuid from the list.
- Parameters
-
- Returns
- True if an element was removed. False if the uuid was not in the list.
◆ Reserve()
void ON_UuidIndexList::Reserve |
( |
size_t |
capacity | ) |
|