Rhino C++ API
8.14
|
#include <opennurbs_array.h>
Public Member Functions | |
ON_UuidIndexList ()=default | |
ON_UuidIndexList (const ON_UuidIndexList &src) | |
ON_UuidIndexList (size_t capacity) | |
~ON_UuidIndexList ()=default | |
bool | AddUuidIndex (ON_UUID uuid, int index, bool bCheckForDupicates=true) |
unsigned int | Count () const |
bool | FindUuid (ON_UUID uuid) const |
bool | FindUuid (ON_UUID uuid, int *index) const |
bool | FindUuidIndex (ON_UUID uuid, int index) const |
unsigned int | GetUuids (ON_SimpleArray< ON_UUID > &uuid_list) const |
void | ImproveSearchSpeed () |
ON_UuidIndexList & | operator= (const ON_UuidIndexList &src) |
void | RemoveAll () |
bool | RemoveUuid (ON_UUID uuid) |
void | Reserve (size_t capacity) |
Description: 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.
|
default |
ON_UuidIndexList::ON_UuidIndexList | ( | size_t | capacity | ) |
|
default |
ON_UuidIndexList::ON_UuidIndexList | ( | const ON_UuidIndexList & | src | ) |
bool ON_UuidIndexList::AddUuidIndex | ( | ON_UUID | uuid, |
int | index, | ||
bool | bCheckForDupicates = true |
||
) |
Description: 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.
unsigned int ON_UuidIndexList::Count | ( | ) | const |
Returns: Number of active uuids in the list.
bool ON_UuidIndexList::FindUuid | ( | ON_UUID | uuid | ) | const |
Description: 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.
bool ON_UuidIndexList::FindUuid | ( | ON_UUID | uuid, |
int * | index | ||
) | const |
bool ON_UuidIndexList::FindUuidIndex | ( | ON_UUID | uuid, |
int | index | ||
) | const |
Description: 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.
unsigned int ON_UuidIndexList::GetUuids | ( | ON_SimpleArray< ON_UUID > & | uuid_list | ) | const |
Description: Append the uuids in this class to uuid_list. Parameters: uuid_list - [in/out] Returns: Number of uuids added to uuid_list.
void ON_UuidIndexList::ImproveSearchSpeed | ( | ) |
Description: 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.
ON_UuidIndexList& ON_UuidIndexList::operator= | ( | const ON_UuidIndexList & | src | ) |
void ON_UuidIndexList::RemoveAll | ( | ) |
Description: Provides an efficient way to empty a list so that it can be used again.
bool ON_UuidIndexList::RemoveUuid | ( | ON_UUID | uuid | ) |
Description: Removes an element with a matching uuid from the list. Parameters: uuid - [in] id to remove Returns: True if an element was removed. False if the uuid was not in the list.
void ON_UuidIndexList::Reserve | ( | size_t | capacity | ) |