C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Loki::Factory and Loki::TList

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Sebastian Faust
Guest





PostPosted: Thu Oct 30, 2003 12:20 pm    Post subject: Loki::Factory and Loki::TList Reply with quote



Hi,

I read about the Loki::Factory and Loki::AbstractFactory in the book Modern
C++ Design and couldnt figure out one thing:
If I have several classes, for example the following hierarchie:

clase Base
{
public:
Base(Base* pBase) : _pBase(pBase) { }
protected:
Base* _pBase;
};

template<typename T, const T myT>
class Derived : public Base
{
protected:
T _t;
}

Now I define the following TList:
TYPELIST_3(Derived<int, 1>, Derived<string, "Hello">, Derived<int, 9>)
my_list;

And now I wanna create all the Objects in in the List connected in the chain
of responsibility, that means after the creation I wanna have the following
structure:
Derived<int, 1> --> Derived<string, "Hello"> --> Derived<int, 9> --> NULL
And the factory should return to me a pointer to the beginning so that means
to: Derived<int, 1>.

Ist such a behavior possible with the Loki::AbstractFactory or
Loki::Factory, or do I have to create my own?

Thanks in advance
Sebastian


Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.