19 ... |
19 ... |
20 TDblQueLink iDlink; |
20 TDblQueLink iDlink; |
21 ... |
21 ... |
22 };</codeblock> |
22 };</codeblock> |
23 <fig id="GUID-30C9DE23-1805-594C-9F7F-BD4A161DE59A"> |
23 <fig id="GUID-30C9DE23-1805-594C-9F7F-BD4A161DE59A"> |
24 <image href="GUID-F342B002-0667-5D51-AE2D-3CF534D70B62_d0e305668_href.png" placement="inline"/> |
24 <image href="GUID-F342B002-0667-5D51-AE2D-3CF534D70B62_d0e326893_href.png" placement="inline"/> |
25 </fig> |
25 </fig> |
26 <p>Although any kind of object can be an element of a linked list, most lists |
26 <p>Although any kind of object can be an element of a linked list, most lists |
27 consist of elements which are all of the same type.</p> |
27 consist of elements which are all of the same type.</p> |
28 <p>An object can participate in more than one list. For example, to allow <codeph>CMyClass</codeph> objects |
28 <p>An object can participate in more than one list. For example, to allow <codeph>CMyClass</codeph> objects |
29 to participate in two doubly linked lists, include two separate <codeph>TDblQueLink</codeph> objects |
29 to participate in two doubly linked lists, include two separate <codeph>TDblQueLink</codeph> objects |
34 TDblQueLink iDlink1; |
34 TDblQueLink iDlink1; |
35 ... |
35 ... |
36 TDblQueLink iDlink2; |
36 TDblQueLink iDlink2; |
37 };</codeblock> |
37 };</codeblock> |
38 <fig id="GUID-DC3DDF09-2F30-5704-ACB0-378622DDDD88"> |
38 <fig id="GUID-DC3DDF09-2F30-5704-ACB0-378622DDDD88"> |
39 <image href="GUID-B131AE10-B9B1-53D2-8CAA-A9045957D6F9_d0e305691_href.png" placement="inline"/> |
39 <image href="GUID-B131AE10-B9B1-53D2-8CAA-A9045957D6F9_d0e326916_href.png" placement="inline"/> |
40 </fig> |
40 </fig> |
41 <p>Elements can also be objects constructed from a variety of classes, all |
41 <p>Elements can also be objects constructed from a variety of classes, all |
42 ultimately derived from the same base class, where that base class includes |
42 ultimately derived from the same base class, where that base class includes |
43 the link object as a component. For example, if <codeph>CBc</codeph> is a |
43 the link object as a component. For example, if <codeph>CBc</codeph> is a |
44 base class for <codeph>CD1</codeph> which, in turn, is a base class for <codeph>CD2</codeph>, |
44 base class for <codeph>CD1</codeph> which, in turn, is a base class for <codeph>CD2</codeph>, |
58 { |
58 { |
59 ... |
59 ... |
60 } |
60 } |
61 </codeblock> |
61 </codeblock> |
62 <fig id="GUID-F8769477-6B6C-5531-9675-AC66FE6B6E3D"> |
62 <fig id="GUID-F8769477-6B6C-5531-9675-AC66FE6B6E3D"> |
63 <image href="GUID-38FF81FD-0C23-586D-AFAE-9F0761A36BAD_d0e305726_href.png" placement="inline"/> |
63 <image href="GUID-38FF81FD-0C23-586D-AFAE-9F0761A36BAD_d0e326951_href.png" placement="inline"/> |
64 </fig> |
64 </fig> |
65 <p>New link elements are inserted into an existing list using either <codeph>TDblQueLink::Enque()</codeph> or <codeph>TDblQueLink::AddBefore()</codeph> function. Note that <codeph>AddBefore()</codeph> is not available in v5. |
65 <p>New link elements are inserted into an existing list using either <codeph>TDblQueLink::Enque()</codeph> or <codeph>TDblQueLink::AddBefore()</codeph> function. Note that <codeph>AddBefore()</codeph> is not available in v5. |
66 These are prototyped as:</p> |
66 These are prototyped as:</p> |
67 <codeblock id="GUID-DDD3FDA3-4635-5AFE-9C17-994E5E4D1C59" xml:space="preserve">void Enque(TDblQueLinkBase* aLink); |
67 <codeblock id="GUID-DDD3FDA3-4635-5AFE-9C17-994E5E4D1C59" xml:space="preserve">void Enque(TDblQueLinkBase* aLink); |
68 </codeblock> |
68 </codeblock> |
69 <codeblock id="GUID-F3E72D69-0180-5BAD-A2C6-E31704820AAF" xml:space="preserve">void AddBefore(TDblQueLinkBase* aLink);</codeblock> |
69 <codeblock id="GUID-F3E72D69-0180-5BAD-A2C6-E31704820AAF" xml:space="preserve">void AddBefore(TDblQueLinkBase* aLink);</codeblock> |
70 <p>Calling <codeph>Enque()</codeph> on an element means that this element |
70 <p>Calling <codeph>Enque()</codeph> on an element means that this element |
71 is added to the list so that its position follows the element <i>aLink</i>, |
71 is added to the list so that its position follows the element <i>aLink</i>, |
72 as the following figure shows.</p> |
72 as the following figure shows.</p> |
73 <fig id="GUID-F46E770B-8BDC-5E61-9E28-043FDAA3B193"> |
73 <fig id="GUID-F46E770B-8BDC-5E61-9E28-043FDAA3B193"> |
74 <image href="GUID-3E1199E4-4F19-58BB-B1EC-8975A04B68FF_d0e305758_href.png" placement="inline"/> |
74 <image href="GUID-3E1199E4-4F19-58BB-B1EC-8975A04B68FF_d0e326983_href.png" placement="inline"/> |
75 </fig> |
75 </fig> |
76 <p>Calling <codeph>AddBefore()</codeph> on an element means that this element |
76 <p>Calling <codeph>AddBefore()</codeph> on an element means that this element |
77 is added to the list so that its position precedes the element <i>aLink</i>, |
77 is added to the list so that its position precedes the element <i>aLink</i>, |
78 as the following figure shows.</p> |
78 as the following figure shows.</p> |
79 <fig id="GUID-0E6C9ADF-0182-52CC-A3D1-AE83F540E42B"> |
79 <fig id="GUID-0E6C9ADF-0182-52CC-A3D1-AE83F540E42B"> |
80 <image href="GUID-2AB5AA00-71B2-58F4-AE17-9A38D1E5AA99_d0e305772_href.png" placement="inline"/> |
80 <image href="GUID-2AB5AA00-71B2-58F4-AE17-9A38D1E5AA99_d0e326997_href.png" placement="inline"/> |
81 </fig> |
81 </fig> |
82 <p>Note that new elements cannot be inserted at the beginning or end of a |
82 <p>Note that new elements cannot be inserted at the beginning or end of a |
83 list using these functions. The <codeph>AddFirst()</codeph> and <codeph>AddLast()</codeph> members |
83 list using these functions. The <codeph>AddFirst()</codeph> and <codeph>AddLast()</codeph> members |
84 of the header class <codeph>TDblQue<class T></codeph> must be used |
84 of the header class <codeph>TDblQue<class T></codeph> must be used |
85 instead.</p> |
85 instead.</p> |