📄 vc25pro_doc_unaclasses.html
字号:
<DIV><P /><H4>Class <A NAME="class_unaList"><SPAN class="class">unaList</SPAN></A>(<A HREF="#class_unaObject"><SPAN class="class">unaObject</SPAN></A>)</H4><P />
This is general purpose list of items.
It is multi-threaded safe, so you can use it by several threads without any special care.
<P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.mapDoFree(doFree: unsigned): bool;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.doSetCapacity(value: unsigned); virtual;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.releaseItem(index: unsigned; doFree: unsigned); virtual;</SPAN><P />
Disposes the item.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.notifyBeforeRemove(index: unsigned); virtual;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.add2(item: pointer): unsigned; overload; virtual;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.insert2(index: unsigned; item: pointer): int; virtual;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.setItem2(index: unsigned; item: pointer; doFree: unsigned = 2); overload; virtual;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.doReverse(); virtual;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.doCopyFrom(list: pInt32Array; listSize: int; copyOperation: unaListCopyOpEnum = unaco_add; startIndex: unsigned = 0): int; virtual;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">constructor <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.create(isObjects: bool = false; const debugTitle: string = '');</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.BeforeDestruction(); override;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.lock(timeout: unsigned = INFINITE): bool;</SPAN><P />
Locks the list. Returns false if lock cannot be set in a timeout period.
If INFINITE is passed timeOut property will be used instead.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.unlock();</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.clear(doFree: unsigned = 2);</SPAN><P />
Clears the list. All items will be removed and count will be reset to 0.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.add(item: pointer): unsigned; overload;</SPAN><P />
Adds item to the end of the list.
Returns list index of inserted item (usually count - 1).
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.add(item: int): unsigned; overload;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.insert(index: unsigned; item: pointer): unsigned;</SPAN><P />
Inserts an item at specified position (index parameter) in the list.
Does nothing if index is bigger than count.
Returns index.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.reverse();</SPAN><P />
Removes an item from the list.
index specifies the index of item to be removed.
doFree specifies an action which should be taken if item is object (see unaObjectList):
<UL>
<LI>0 -- do not free the object</LI>
<LI>1 -- free object always</LI>
<LI>2 -- use the autoFree member of unaObjectList to decide whether to free the object.</LI>
<UL>
Reverses items in the list.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.removeByIndex(index: unsigned; doFree: unsigned = 2): bool; overload;</SPAN><P />
Removes item with specified index from the list.
Returns true if item was removed, or false otherwise.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.removeItem(item: int; doFree: unsigned = 0): bool; overload;</SPAN><P />
Removes specifed item from the list.
Returns true if item was removed, or false otherwise.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.removeItem(item: pointer; doFree: unsigned = 2): bool; overload;</SPAN><P />
Removes specified item from the list.
Returns true if item was removed, or false otherwise.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.removeFromEdge(removeFromBegining: bool = true): bool;</SPAN><P />
Removes first (removeFirst = true) or last (removeFirst = false) item from the list (if it presents).
Returns true if item was removed, or false otherwise.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.asString(const delimiter: string; treatAsSigned: bool = true; base: unsigned = 10): string;</SPAN><P />
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.get(index: unsigned): pointer;</SPAN><P />
Returns item from the list.
index specifies the index of item to be returned.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.getObject(index: unsigned): tObject;</SPAN><P />
Returns item with specified index as object.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.setItem(index: unsigned; item: pointer; doFree: unsigned = 2); overload;</SPAN><P />
Sets item value in the list.
index specifies the index of item to be set.
item is value of item. Old item will be freed.
If old item is object, doFree parameter specifies the action should be taken.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.setItem(index: unsigned; item: int); overload;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.setItem(itemToReplace: pointer; newItem: pointer; doFree: unsigned = 2): unsigned; overload;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">procedure <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.setCapacity(value: unsigned);</SPAN><P />
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.locate(value: pointer): int; overload;</SPAN><P />
Searches the list for specified item. Returns -1 if no item was found.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.locate(value: unsigned): int; overload;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.locate(value: int): int; overload;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.copyTo(out list: pInt32Array; includeZeroIndexCount: bool): int;</SPAN><P />
Creates a array and copies list items into it.
<BR />If includeZeroIndexCount is true, the first elemet of array will contain number of items in it.
<P />Returns size of created array (in bytes).
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.copyFrom(list: pInt32Array; listSize: int; copyOperation: unaListCopyOpEnum = unaco_add; startIndex: unsigned = 0): int; overload;</SPAN><P />
Returns number of items processed.
If listSize is -1 list has "zero index count", i.e. number of items is stored as first item of the list.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.copyFrom(list: <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>; copyOperation: unaListCopyOpEnum = unaco_add; startIndex: unsigned = 0): int; overload;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.assign(list: <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>): int;</SPAN><P />
Returns number of items copied.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.waitForData(timeout: unsigned = 100): bool;</SPAN><P />
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">function <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.checkDataEvent(): bool;</SPAN><P />
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.count: unsigned;</SPAN><P />
Number of items in the list.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.autoFree: bool;</SPAN><P />
Set this property to true for lists which know how to free own items, to allow items to be freed by the list.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.timeOut: unsigned;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.item[]: pointer;</SPAN><P />
Returns list item by it index.
</TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.debugTitle: string;</SPAN><P /></TD></TR></TABLE><P /><TABLE BORDER="1" width="100%"><TR><TD><SPAN class="source">property <A HREF="#class_unaList"><SPAN class="class">unaList</SPAN></A>.oneThreadUser: bool;</SPAN><P />
When this property is true list will not use gate to protect internal data in multi-threading access. This may increase performance a little.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -