Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Polymorphic XML
Re: Polymorphic XML [message #24358 is a reply to message #24353] |
Tue, 12 January 2010 10:42 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
luzr wrote on Tue, 12 January 2010 08:05 |
__LamelPageArray &LamelPageFactory()
{
static One<__LamelPageArray> pages;
if(!pages)
pages = new __LamelPageArray;
return *pages;
}
Why not
__LamelPageArray &LamelPageFactory()
{
static __LamelPageArray pages;
return pages;
}
?
|
Yep, better... and it could be made a static member of Page class, also.
Quote: |
Also, I believe that
void CreateClassInstance(One<BaseClass>& x);
(Note that you can do x.Create<DerivedClass>())
or even in some cases
void CreateClassInstance(Array<BaseClass>& x);
is cleaner class factory interface. (But depends on your taste).
Mirek
|
mhhh... I don't understand your point. I need the class creation at runtime by name, so an ascii string, not a type.
Anyways, thinking about it, all the stuff could be polished a bit, also using callbacks, maybe, instead of function pointers.
BTW, yesterday I was in a hurry because the problem was starting boring me, so I solved it quick and dirty
Ciao
Max
|
|
|
Goto Forum:
Current Time: Mon May 13 05:23:24 CEST 2024
Total time taken to generate the page: 0.01866 seconds
|