[vlc-devel] [RFC] LibVLC media_list_enumerator

Pierre d'Herbemont pdherbemont at free.fr
Thu Sep 6 13:27:32 CEST 2007


On Sep 6, 2007, at 12:04 AM, Damien Fouilleul wrote:

> typically enumerators/iterators don't provide indexing type ability,
> because the query behind the enumerator may not easily provide that  
> sort
> of operation (without using an array internally), but if you think  
> that
> this does not add any code complexity, then go for it. Typically,  
> if an
> enumerator requires a complex state machine or maintain some sort of
> array internally, then we may be better of getting an array rather  
> than
> an enumerator

Then, I am mistaken. It is way more convenient to have an index  
associated with an item. I understand that we loose some flexibility  
of the enumerator... In our case, I had planned to maintain an array  
of item in the enumerator. And accessing those enumerator through an  
index seems easier.

Thus we may don't want to name this class enumerator, and have an  
array. In our case the array is really close to the media_list type.

>>
> some iterators may be read only due to the internal query driving them
> (.ie sort by artist and enumerate), this should be optional or in a  
> subclass

Of course, but because subclass is hard, that will be optional.

>> In the media_list the following would be added:
>>
>> libvlc_media_list
>> 	_all_media_enumerator
>> 	_node_enumerator
>> 	_enumerator
>>
>>
> what is the difference b/w all all_media_enumerator and enumerator,  
> does
> one exclude nodes ?

Yes. Obviously then the name is wrong. Probably flat_view would suite  
a bit better. Or one_level.

Thanks,

Pierre.



More information about the vlc-devel mailing list