Re: GTree



Hi,

Florian Scandella <flo scandella aon at> writes:

> I have seen that you have added a 'destroy notify' function to GHash. 

The patch you are speaking about has not yet been applied. 

> I think this would also be a good feature in GTree and G[S]List.

I submitted an equivalent patch for Gtree which should be considered
after we have decided on the GHash API. IMHO the GTree API should
indeed be very similar to the GHash API. This makes it easier to use
both as specialized implementations of a more general data container.

A destroy notifier does not make much sense for GLists since they lack
the concept of a key.

> Actually ( in a litte programm i wrote ) i store the data in a GSList 
> and pointers in the GTree. Then i first delete the data in the list and 
> then destroy the tree ... maybe i'm missing some functionality of glib 
> and this could be done a better way.

I guess you have a special reason for this configuration, since Gtree
also allows a linear list-like access using g_tree_traverse. Anyway, 
the proposed API will probably make the usage of trees and hashes more 
intuitive 


Salut, Sven






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]