The ON_UuidPairList class provides a tool to efficiently maintain a list of uuid 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_UuidPairList class provides a tool to efficiently maintain a list of uuid 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_UuidPairList() [1/3]
ON_UuidPairList::ON_UuidPairList |
( |
| ) |
|
◆ ON_UuidPairList() [2/3]
ON_UuidPairList::ON_UuidPairList |
( |
int |
capacity | ) |
|
◆ ~ON_UuidPairList()
ON_UuidPairList::~ON_UuidPairList |
( |
| ) |
|
◆ ON_UuidPairList() [3/3]
◆ AddPair()
bool ON_UuidPairList::AddPair |
( |
ON_UUID |
id1, |
|
|
ON_UUID |
id2, |
|
|
bool |
bCheckForDupicates = true |
|
) |
| |
Adds a uuid-index pair to the list.
- Parameters
-
id1 | [in] id to add. |
id2 | [in] id to add. |
bCheckForDupicates | [in] if true, then the pair is not added if id1 is already in the list. If you are certain that the id1 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 the pair was added. False if the pair was not added because it is already in the collection.
You cannot add the pair value ( ON_max_uuid, ON_max_uuid ). This pair value is used to mark removed elements in the ON_UuidPairList[].
◆ Count()
int ON_UuidPairList::Count |
( |
| ) |
const |
- Returns
- Number of active uuids in the list.
◆ Empty()
void ON_UuidPairList::Empty |
( |
| ) |
|
Provides an efficient way to empty a list so that it can be used again.
◆ FindId1()
bool ON_UuidPairList::FindId1 |
( |
ON_UUID |
id1, |
|
|
ON_UUID * |
id2 = 0 |
|
) |
| const |
Determine if an element with a uuid is in the list.
- Parameters
-
id1 | [in] |
id2 | [out] if not nullptr and a matching id1 is found, then *id2 is set to the value of the second uuid. |
- Returns
- True if an element was found. Returns false if the id1 is not in the list.
◆ FindPair()
Determine if an id pair is in the list.
- Returns
- True if the id pair is in the list. False if the id pair is not in the list.
◆ GetId1s()
Append the value of the first id in each pair to uuid_list[].
- Parameters
-
- Returns
- Number of ids appended to uuid_list[].
◆ ImproveSearchSpeed()
void ON_UuidPairList::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=()
◆ Read()
◆ RemovePair() [1/2]
bool ON_UuidPairList::RemovePair |
( |
ON_UUID |
id1 | ) |
|
Removes an element with a matching id1 from the list.
- Parameters
-
- Returns
- True if an element was removed. False if the id1 was not in the list.
◆ RemovePair() [2/2]
Removes an element with a matching id pair from the list.
- Parameters
-
- Returns
- True if an element was removed. False if the id pair does not appear in the list.
◆ Reserve()
void ON_UuidPairList::Reserve |
( |
size_t |
capacity | ) |
|
◆ Write()
◆ EmptyList