It consists of using the functions provided by the OS (dlopen/dlsym for Unix-based systems including Mac OS X and LoadLibrary/GetProcAddress for MS Windows).
Each plugin will have to provide two functions with C linkage:
-
extern "C" void create_utility(WorkPlace* workplace)
-
extern "C" void receive_message(const std::string& workplace_name, TcpConnection* tcp_connection, const std::string& message)
The first function (create_utility) is a factory function that takes care of creating new instances of the utility.
The way it should work is that a new instance of the utility class is created for each workplace. This Utility class wouldn't have to derive from any other base class as is normally done with C++ plugins.
The way it should work is that a new instance of the utility class is created for each workplace. This Utility class wouldn't have to derive from any other base class as is normally done with C++ plugins.
The second function (receive_message) is used to receive network messages coming from clients, mostly from its utility counterpart on the client-side.
Keep in mind that this implementation will only be for the server. The Qt QPluginLoader framework will probably have to be used on the client. I didn't want to use this on the server to not introduce Qt as a dependency for the server.
Also, the plugin system on the server doesn't require much flexibility. The current design is rather simple and seems to work quite well so far. The UtilityManager class is less than 50 (real) lines of code.
One thing I haven't introduced yet is a way for utilities to communicate with each other internally (within the server). A few ideas that I can think off the top of my head to implement this, might to require the addition of another function with external C linkage to pass internal messages. Not sure how flexible this would be do.
Another option would be to use Boost.Signal2.
With this, and some more work on the Mira framework, I should be able to produce some simple utilities rather easily. Still some design issues that I'm gathering need to be worked out.
One thing I haven't introduced yet is a way for utilities to communicate with each other internally (within the server). A few ideas that I can think off the top of my head to implement this, might to require the addition of another function with external C linkage to pass internal messages. Not sure how flexible this would be do.
Another option would be to use Boost.Signal2.
With this, and some more work on the Mira framework, I should be able to produce some simple utilities rather easily. Still some design issues that I'm gathering need to be worked out.
1 comment:
To decide the position of the primary reel, the pc divides the primary random quantity by a set value. Whenever the slot machine is turned on, the random quantity generator is spitting out complete numbers hundreds of times a second. The immediate you pull the arm again , the pc information the next few numbers from the random quantity generator. Then it feeds these numbers by way of a simple program discover out} the place the reels ought to cease. During the 1920s the machines have been well-liked all through much of the United States, especially in resort areas, they usually continued to be well-liked into the Great 안전한 카지노사이트 Depression years of the ’30s.
Post a Comment