UUID List

From SDK
Jump to navigation Jump to search
Back.jpg

Object which holds a list of UUID’s (note NOT luaUUID’s these are ‘raw’ UUID’s).

Constructor

UUID_List()

Creates a new empty UUID_List

Local uuid_list = UUID_List()


Properties

.Count

Read Only - integer – return the number of ids in the list



.IsEmpty

Read Only - bool – return true if the id list is empty

Methods

:AddHead( UUID id)

Add the passed id to the front of the list

id –UUID –id to put in list



:AddTail( UUID id)

Add the passed id to the end of the list

id –UUID –id to put in list



:GetAt(pos)

Returns the id at the current position

pos – POSITION – current position in list



:GetHeadPosition()

Returns a POSITION variable to allow access to the head of the list



:GetNext(POSITION pos)

Returns the id at the current position AND a new value for position pointing to the next item in the list (or nil if at end of list)

pos – POSITION – current position in list
note that GetNext(pos) is returning two values ...

Usage Syntax:

    local pos = uuid_list:GetHeadPosition() 
      local id 
      while pos ~= nil do  
         id, pos = uuid_list:GetNext(pos)     
         DO SOMETHING WITH ID .... 
      end -- while end  

:GetPrev(POSITION pos)

Returns the toolpath at the current position AND a new value for position, pointing to the previous item in the list (or nil if at start of list)

pos – POSITION – current position in list



:GetTailPosition()

Returns a POSITION variable to allow access to the tail (end) of the list toolpaths



:Find(UUID id)

Return the POSITION of passed id in list. Returns nil if id not in list position

id –UUID –id to find in list



:FindIndex(UUID id)

Return the index of passed id in list. Returns -1 if id not in list position

id –UUID –id to find in list



:InsertAfter(POSITION pos, UUID id)

Insert the id after the passed position

pos – POSITION –position in list
id –UUID –id to put in list



:InsertBefore(POSITION pos, UUID id)

Insert the id before the passed position

pos – POSITION –position in list
id –UUID –id to put in list



:RemoveAll()

Remove all ids from the list



:RemoveAt(POSITION pos)

Remove the id at the current position

pos – POSITION – current position in list



:RemoveHead()

Remove the id at the front of the list and return it



:RemoveTail()

Remove the id at the end of the list and return it



:SetAt(POSITION pos, UUID id)

Replace the id at the passed position with the new value

pos – POSITION –position in list
id – UUID – id to put in list


Back.jpg

References

Please Note: The base material for the contents found in this WiKi was sourced from Vectric Lua Interface for Gadgets, version 2.05, published September 12, 2018. by Vectric Ltd. Most current document from Vertric can be downloaded at Vertric Developer Information