C++ Framework

Started by
9 comments, last by JimCrafton 23 years, 2 months ago
Sly: No, it indicates that there are usually faster, simpler, more efficient ways of doing things than using an extended form of RTTI.

I designed a GUI that could do that and more, and the most RTTI it used was a factory, where allocators were keyed to strings containing the class names, which were generated at run-time by typeid(). Lack of foresight, indeed. Try virtual functions:



class window
{
public:
virtual void configure()
{
// bring up dialog box for data members
}
};

class edit_control : public window
{
public:
virtual void configure()
{
// bring up dialog box for data members
// must also process base''s data members
}
};



GUI hierarchies should be shallow, so this isn''t bad. And it allows derived classes the flexibility to hide base class traits that make absolutely no sense in the derivation and/or to build a different interface to certain base class traits.

This topic is closed to new replies.

Advertisement