I am trying to write a wrapper class for the Poco functions that I use.
Here is my code:
//PocoWrapper.h
#include <stdio.h>
#include <Poco/Task.h>
#include <Poco/TaskManager.h>
#include <Poco/ThreadPool.h>
namespace myNamespace{
class ThreadPool : Poco::ThreadPool{};
}
Now if I include PocoWrapper.h in another script, I should be able to use:
myThreadPool = new myNamespace::ThreadPool(1,4);
But This gives the error:
//error: C2661: 'myNamespace::ThreadPool::ThreadPool' : no overloaded function takes 2 arguments
However, if I use:
myThreadPool = new Poco::ThreadPool(1,4);
It compiles fine. Therefore the problem must be that it is not inheriting the default values for the functions from the Poco::ThreadPool Class.
The ThreadPool constructor has default values, so it should be able to be used with only 2 arguments. From the documentation:
ThreadPool(
int minCapacity = 2,
int maxCapacity = 16,
int idleTime = 60,
int stackSize = 0
);
How can I make my wrapper class work with only two arguments, like the base class does?
I am not using c++11.