Hey Lars,
2009/7/7 Lars Hamren <[email protected]>:
> As for DLL:s, they are not strictly necessary to make the ABC useful.
> Applications can still have their own, application-specific,
> connectors linked in.
>
> I would suggest putting the the standard connectors into libwt, and
> then optionally search a path for DLL:s. A reasonable default path
> would be
>
> the directory where the application resides
> the directory where libwt.so resides
>
> Such shared libraries should, I think, have a prefix:
>
> wt-connector-fcgi.so
> wt-connector-http.so
Sounds good.
> In C++, connectors can be registered something like this:
>
> class ConnectorFactories {
> public:
> typedef WServer *(*Factory)(parameters...);
> void register_factory(string name, Factory *f);
> Factory *find(string name);
> }
I would also add a:
Factory *getTheFactory();
which would then be used by the current WRun() and which simply
returns the sole registered factory (which was linked in) or fails if
multiple or no factories were available.
> and in each WServer implementation
>
> static FcgiServer *fcgiConnectorFactory(parameters...) { return new ... }
>
> static class FcgiConnectorRegistrant { // class name must be unique or
> MSVC will fail
> FcgiConnectorRegistrant() {
> ConnectorFactories::register_factory("fcgi",
> fcgiConnectorFactory);
> }
> } fcgiConnectorRegistrant;
>
> The FcgiConnectorRegistrant is just a roundabout way of calling
> ConnectorFactories::register_factory. Note that no symbols need to be
> exported, so
> everything can be declared static to avoid cluttering up the global namespace.
>
> Care must be taken when implementing ConnectorFactories, as we can not be sure
> that a global instance of ConnectorFactories will be initialized before
> the registrants.
I like this proposal since it provides the same behavior as the
current setup (unless we are overlooking something?).
I am only worried about the cross-platform'ness of ldopen() and co,
especially for MSVC platforms ?
Regards,
koen
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest