Re: [Boost-users] [Boost.Parameter] How to Use Named Parameters in a Class Hierarchy?
From: "Wu Yinghui, Freddie"
To use the class hierarchy, my program loads the DLL requested by user using LoadLibrary() (We're using Windows, but it should be similar to Linux, I suppose), and makes use of the Derived1/Derived2 classes via a pointer to the Base class.
Since I have no information about the derived classes when building my main executable (only Base class is known then), I cannot make direct use of Derived1/Derived2 types in my main program. -- Yet, I need a way to provide some arbitrary set of arguments to the derived classes.
Hope my explanation clears your doubts. Do you have any suggestion or alternative design in mind?
Try a single boost::any parameter. Then pass structures as needed. This is essentially equivalent to the void* method everyone used in the bad old pre-Boost days, but it's type-safe. - James Jones Administrative Data Mgmt. Webmaster 375 Raritan Center Pkwy, Suite A Data Architect Edison, NJ 08837
participants (1)
-
james.jonesīŧ firstinvestors.com