One of my client ask me to build a version of our software that used CVB and is in a production computer “online”, to be use “offline” with a portable computer where CVB is not installed, to be able to work on recorded image.
So, we want to build a version of our software where all call of the CVB tools are replace with a “fake” camera class.
To do so, we build our own camera class that encapsulate CVB tools. So we can switch between a false camera class and this class easily.
For now, the best solution for us is to create two version of the software, one who use CVB, one whe do not use CVB. But as a developer, I do not want this solution because it can create problems…
My question is : is there a way, in modern C++, to manage the use of CVB in our code, so that we can detect if cvb is installed and use the true cvb camera class or the false camera class that you know ? Or any other ideas ? I know that we can use function pointer to do that, but I want to avoid it.
As this is mainly a CVB unrelated question we can´t invest time in finding a suitable solution for you. What I can tell you right away is that doing something like this you have to get rid of the CVB library dependencies in your code.
To do this dynamically it should work when you encapsulate the CVB functionality into a DLL which you load dynamically. If this fails because CVB is not installed you can use your dummy implementation.
Hi @Sebastian
I understand. I was looking for some feedback that you may have on your side, not something complete. I can managed that on my own, and sorry if it’s not cvb related.
Hi,
So first, thanks @Sebastian, i did that and it’s work good !
@s-woe I don’t really know why my client doesn’t want to install CVB in others computers than the production computer. Maybe for security, or for limited installed programs on professionnal laptop hos the company.
But that is ok, we have resolve this. Thanks for your time, as always.