example of factory where derived class constructors have different signatures
Hi, How factory can be used when derived classes need constructing with different args? Could someone show an sample? Thank you, Vic
struct IFactory { virtual boost:: intrusive_ptr<IClass> createIClass( const std::vector<boost::any> &) const = 0; }; or even arguments by name: struct IFactory { virtual boost:: intrusive_ptr<IClass> createIClass( const std::map<std::string, boost::any> &) const = 0; }; -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Victor Whiskey Yankee Sent: Thursday, January 08, 2009 15:25 To: boost-users@lists.boost.org Subject: [Boost-users] example of factory where derived class constructors have different signatures Hi, How factory can be used when derived classes need constructing with different args? Could someone show an sample? Thank you, Vic _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Look in the serialization library. There is a sublibrary - extended_type_info which implements this functionality. Robert Ramey Victor Whiskey Yankee wrote:
Hi,
How factory can be used when derived classes need constructing with different args?
Could someone show an sample?
Thank you, Vic
participants (3)
-
peter_foelscheļ¼ agilent.com
-
Robert Ramey
-
Victor Whiskey Yankee