Boost logo

Boost Users :

From: Nicholas Yue (yue.nicholas_at_[hidden])
Date: 2022-02-02 22:11:31


Hi,

  I am learning about <boost/dll/shared_library.hpp>

  So far I have manage to follow along with the tutorial I believe
https://www.boost.org/doc/libs/1_77_0/doc/html/boost_dll/tutorial.html

  Using tutorial 5 as an illustration

https://github.com/apolukhin/Boost.DLL/blob/develop/example/tutorial5/load_all.cpp

  On this line, I will have the ability to reference the object of
my_api_sum I believe

https://github.com/apolukhin/Boost.DLL/blob/develop/example/tutorial5/load_all.cpp#L99

  I have the following questions:

   1. If I have a class that is e.g. a shape, say rectangle (of different
   sizes), what approach may I use to create different instances of the class
   from the plugin?
   2. If my class requires parameters for it's construction, how do I pass
   it via the shared library loading mechanism ?

  Or have I been looking to use boost dll shared_library wrongly and that I
might look at the plugin being some sort of factory design approach ?

  Thank you in advance.

Cheers

-- 
Nicholas Yue
https://www.linkedin.com/in/nicholasyue/


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net