Mailing List archive

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

[vdr] Re: OSD: is it allowed to have multiple instances



Klaus Schmidinger writes:
 > > you could make the cOsd class a singleton. you are aware of this design
 > > pattern, arn't you?
 > > 
 > > best regards ...
 > > clemens
 > 
 > I guess that's what I was aiming at by suggesting to make
 > cDvbOsdProvider::CreateOsd() return NULL in case another cOsd is
 > requested before the previous one has been destroyed.
 > 
 > Or is there something special about this? At least the C++ book
 > doesn't mention it.

When using a singleton, the method returns a pointer to the existing
instance if there is, and creates a new one if there is not.  

For a reference, see the GOF book:
Gamma, Helm, Johnson, Vlissides: Design Patterns 

yours,
		Jouni

-- 
http://www.netlab.hut.fi/%7ekex




Home | Main Index | Thread Index