Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: VDR Plugin System - First Step
Stefan Huelswitt wrote:
>
> On 10 May 2002 Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de> wrote:
>
> >> @@ -147,8 +149,8 @@
> >> T *Get(int Index) const { return (T *)cListBase::Get(Index); }
> >> T *First(void) const { return (T *)objects; }
> >> T *Last(void) const { return (T *)lastObject; }
> >> - T *Prev(const T *object) const { return (T *)object->Prev(); }
> >> - T *Next(const T *object) const { return (T *)object->Next(); }
> >> + T *Prev(const T *object) const { return (T *)object->cListObject::Prev(); }
> >> + T *Next(const T *object) const { return (T *)object->cListObject::Next(); }
> >> };
> >>
> >> else compiling fails for classes which are ListObject and
> >> ListBase at one. e.g.:
> >>
> >> class cPlayList : public cConfig<cMP3>, public cListObject {
> >> };
> >
> > Is that really a good idea to derive cPlayList from cConfig *and* cListObject?
> > Shouldn't cPlayList rather have a *member* of type cConfig?
>
> Oh, I think the structure is not visible from this small piece of
> code. Actually I have
>
> class cPlayLists : public cList<cPlayList>
> class cPlayList : public cConfig<cMP3>, public cListObject
> class cMP3 : public cListObject
>
> so cPlaylist is a cListObject in cPlayLists AND a cListBase for
> cList<cMP3> (covered in cConfig<cMP3> to use the parsing
> functions).
>
> In this case cPlayList::Next() is ambiguous (cListObject::Next()
> or cListBase::Next()) The same for Prev().
>
> Hope that this isn't to weird :-)
Ok, I see know what you're doing.
The classes you define result in a "list of lists", and there it is
necessary to make sure the right Prev() and Next() gets called.
I'll include your modification in version 1.1.1.
Klaus
--
_______________________________________________________________
Klaus Schmidinger Phone: +49-8635-6989-10
CadSoft Computer GmbH Fax: +49-8635-6989-40
Hofmark 2 Email: kls@cadsoft.de
D-84568 Pleiskirchen, Germany URL: www.cadsoft.de
_______________________________________________________________
Home |
Main Index |
Thread Index