Rhino C++ API  8.13
Public Member Functions | Static Public Member Functions | List of all members
ON_UuidList Class Reference

#include <opennurbs_array.h>

Inheritance diagram for ON_UuidList:
ON_SimpleArray< ON_UUID >

Public Member Functions

 ON_UuidList ()
 
 ON_UuidList (const ON_UuidList &src)
 
 ON_UuidList (int capacity)
 
 ~ON_UuidList ()
 
bool AddUuid (ON_UUID uuid, bool bCheckForDupicates=true)
 
const ON_UUIDArray () const
 
void Compact ()
 
int Count () const
 
void Destroy ()
 
void Empty ()
 
bool FindUuid (ON_UUID uuid) const
 
int GetUuids (ON_SimpleArray< ON_UUID > &uuid_list) const
 
bool operator!= (const ON_UuidList &other) const
 
ON_UuidListoperator= (const ON_UuidList &src)
 
bool operator== (const ON_UuidList &other) const
 
bool Read (class ON_BinaryArchive &archive)
 
bool Read (class ON_BinaryArchive &archive, bool bSortAferRead)
 
void RemapUuids (const ON_SimpleArray< ON_UuidPair > &uuid_remap)
 
bool RemoveUuid (ON_UUID uuid)
 
void Reserve (size_t capacity)
 
bool Write (class ON_BinaryArchive &archive) const
 
bool Write (class ON_BinaryArchive &archive, bool bSortBeforeWrite) const
 

Static Public Member Functions

static int CompareUuid (const ON_UUID *a, const ON_UUID *b)
 

Detailed Description

Description: 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.

Constructor & Destructor Documentation

◆ 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]

ON_UuidList::ON_UuidList ( const ON_UuidList src)

Member Function Documentation

◆ AddUuid()

bool ON_UuidList::AddUuid ( ON_UUID  uuid,
bool  bCheckForDupicates = true 
)

Description: 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

Returns: Array of uuids in the list. Sorted with respect to ON_UuidList::CompareUuid(). Remarks: Calling AddUuid() may grow the dynamic array and make the pointer invalid.

◆ Compact()

void ON_UuidList::Compact ( )

Description: Makes the uuid list as efficient 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 modified. 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

Description: 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 ( )

Description: Destroy list. If list will be reused, Empty() is more efficient.

◆ Empty()

void ON_UuidList::Empty ( )

Description: Provides an efficient way to empty a list so that it can be used again.

◆ FindUuid()

bool ON_UuidList::FindUuid ( ON_UUID  uuid) const

Description: Determine if a uuid is in the list. Returns: True if uuid is in the list.

◆ GetUuids()

int ON_UuidList::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.

◆ operator!=()

bool ON_UuidList::operator!= ( const ON_UuidList other) const

◆ operator=()

ON_UuidList& ON_UuidList::operator= ( const ON_UuidList src)

◆ operator==()

bool ON_UuidList::operator== ( const ON_UuidList other) const

◆ Read() [1/2]

bool ON_UuidList::Read ( class ON_BinaryArchive archive)

Description: Read the uuid list from an archive. Parameters: archive - [in] archive to read from. Returns: true if the read was successful.

◆ Read() [2/2]

bool ON_UuidList::Read ( class ON_BinaryArchive archive,
bool  bSortAferRead 
)

Description: 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()

void ON_UuidList::RemapUuids ( const ON_SimpleArray< ON_UuidPair > &  uuid_remap)

Description: This tool is used in rare situations when the object ids stored in the uuid list need to be remapped. Parameters: uuid_remap - [in] Is it critical that uuid_remap[] be sorted with respect to ON_UuidPair::CompareFirstUuid.

◆ RemoveUuid()

bool ON_UuidList::RemoveUuid ( ON_UUID  uuid)

Description: Removes a uuid from the list. Parameters: uuid - [in] id to remove 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]

bool ON_UuidList::Write ( class ON_BinaryArchive archive) const

Description: 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

Description: 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.