I want to write a plugin architecture for Linux. I've tried researching how to do it, but I actually keep running into information for more complex plugin architecture then what I need, I want only a very basic implementation.
To explain what I'm doing, I have a program that accepts and process input from various sources, multiple instances of the same program will likely run with each instance accepting a different input source. I want to do some level of error checking and correction but the logic for such error checking will vary dependent on input source. So I want my program to open a plugin for the specific source it's reading in (the plugin name would presumable be in the config file) and run an error check method provided by library. This is more basic than most of the architectures and information I see for plugins because
- It's not cross platform. I know I’ll be using x86 linux platform, and could even define an exact compiler if necessary
- The 'plugin' is very basic, it could be as little as a single method provided by each plugin.
However, there are two things I must have
1) It must be fast. I'll be reading in streaming data at high volume and need to process it quickly. I've crossed out the use of scripting agents for this very reason, I was afraid the overhead of translating scripting logic for every input may be to great
2) I must be able to detect an update to an existing .SO and load the new version without stopping the program.
I'm still semi-new to c++ in general and so am a little apprehensive about trying to develop anything too complicated. I'm looking to determine what the easiest viable solution is for me.
I've considered Boost.Extension, but it may actually be overkill for what I need. I'm trying to decide if it's better to just define the .SO by hand rather than trying to use the Boost framework due to how simple my use case is. There also are some small headaches with using Boost where I work, I can do it but I would have to jump through a few hoops to get permission.
So can anyone tell me if 1) plugin architecture is really what I should be trying here (is there an easier solution?) 2) if they think Boost.Extensions is the best approach 3) can point me to any documents that describe how to make a platform-specific plugin architecture (I've seen plenty talking about platform independent, but I don't need to do anything that complicated). 4) what is the best way to ensure I load a newer version of a library while running? preferable a method that avoids an if statement every time I accept input due to the earlier stated need for fast processing.