Rhino C++ API
8.13
|
#include <opennurbs_array.h>
Public Member Functions | |
ON_UuidPairList () | |
ON_UuidPairList (const ON_UuidPairList &src) | |
ON_UuidPairList (int capacity) | |
~ON_UuidPairList () | |
bool | AddPair (ON_UUID id1, ON_UUID id2, bool bCheckForDupicates=true) |
int | Count () const |
void | Empty () |
bool | FindId1 (ON_UUID id1, ON_UUID *id2=0) const |
bool | FindPair (ON_UUID id1, ON_UUID id2) const |
int | GetId1s (ON_SimpleArray< ON_UUID > &uuid_list) const |
void | ImproveSearchSpeed () |
ON_UuidPairList & | operator= (const ON_UuidPairList &src) |
bool | Read (class ON_BinaryArchive &archive) |
bool | RemovePair (ON_UUID id1) |
bool | RemovePair (ON_UUID id1, ON_UUID id2) |
void | Reserve (size_t capacity) |
bool | Write (class ON_BinaryArchive &archive) const |
Static Public Attributes | |
static const ON_UuidPairList | EmptyList |
Description: 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::ON_UuidPairList | ( | ) |
ON_UuidPairList::ON_UuidPairList | ( | int | capacity | ) |
ON_UuidPairList::~ON_UuidPairList | ( | ) |
ON_UuidPairList::ON_UuidPairList | ( | const ON_UuidPairList & | src | ) |
Description: 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. Remarks: 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[].
int ON_UuidPairList::Count | ( | ) | const |
Returns: Number of active uuids in the list.
void ON_UuidPairList::Empty | ( | ) |
Description: Provides an efficient way to empty a list so that it can be used again.
Description: 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.
Description: 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.
int ON_UuidPairList::GetId1s | ( | ON_SimpleArray< ON_UUID > & | uuid_list | ) | const |
Description: Append the value of the first id in each pair to uuid_list[]. Parameters: uuid_list - [in/out] Returns: Number of ids appended to uuid_list[].
void ON_UuidPairList::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_UuidPairList& ON_UuidPairList::operator= | ( | const ON_UuidPairList & | src | ) |
bool ON_UuidPairList::Read | ( | class ON_BinaryArchive & | archive | ) |
bool ON_UuidPairList::RemovePair | ( | ON_UUID | id1 | ) |
Description: Removes an element with a matching id1 from the list. Parameters: id1 - [in] id to remove Returns: True if an element was removed. False if the id1 was not in the list.
Description: Removes an element with a matching id pair from the list. Parameters: id1 - [in] id2 - [in] Returns: True if an element was removed. False if the id pair does not appear in the list.
void ON_UuidPairList::Reserve | ( | size_t | capacity | ) |
bool ON_UuidPairList::Write | ( | class ON_BinaryArchive & | archive | ) | const |
|
static |