What are TCollection's accessor methods? 
Author Message
 What are TCollection's accessor methods?

I want to change the way a TCollection stores its data. What are the
accessor methods use by TCollections? Will overloading At, AtInsert,
AtDelete, and FreeItem be enough?


Wed, 18 Jun 1902 08:00:00 GMT  
 What are TCollection's accessor methods?

Quote:

> I want to change the way a TCollection stores its data. What are the
> accessor methods use by TCollections? Will overloading At, AtInsert,
> AtDelete, and FreeItem be enough?

The source is in Objects.PAS, here you see all you need.

I used TCollection and TSortedcollection without modification
of the original to store longints instead of pointers, which
were simple record numbers in a file. It worked smoothly.
The main limitation is the 64k boundary, so you can have a
maximum Count of 163xx.

Franz Glaser



Wed, 18 Jun 1902 08:00:00 GMT  
 What are TCollection's accessor methods?

Quote:

>I want to change the way a TCollection stores its data. What are the
>accessor methods use by TCollections? Will overloading At, AtInsert,
>AtDelete, and FreeItem be enough?

Not sure how much I can help you because you don't say how or why you want to
change it, however TCollections assume they hold a collection TObject
decendants, so the collection itself (TCollection.List) is an array of pointers
to TObject's. If you want to store non-TObjects, or non-dynamically allocated
TObject descendants in the collection you must override FreeItem, GetItem and
PutItem.

BTW, in direct answer to your subject line, the only ancestor methods of
TCollection are those inherited from TObject - Init, Done and Free, all of
which are overridden by TCollection.

-- Jay

 -----------------------------------------
| Jason Burgon - author of Graphic Vision |

| http://www.jayman.demon.co.uk           |
 -----------------------------------------



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. 'Locate' method with filtered dataset

2. Help: The 'SaveToFile' method for RichEdits

3. TQuery's locate method doesn't work properly

4. I am missing something and I can't run my PAS files

5. Borland Turbo Pascal Numerical Method's Toolbox

6. TDataset's ActiveBuffer method

7. property write method's problem....

8. Getting a method's address

9. Getting a method's address

10. Newton's Method

11. Transaction Methods in Interbase using Delphi 3.0 -Problems in commit-rollback methods

12. FPC: Wrong behavior in nested use of TCollection.ForEach

 

 
Powered by phpBB® Forum Software