I'm keen on using boost's object_pool class for memory re-use for a set of video frames.
boost::object_pool< VideoFrame > FramePool;
Now, the VideoFrame class has two constructors. The first version of the constructor takes 4 arguments while the second version takes 6 arguments/parameters.
For every "new" video frame that is allocated, I would like to call the constructor on the object either using the 4 or 6 parameter version. For example:
//VideoFrame *F = new VideoFrame(IdeckLinkOutput, &R, PixelFormat, FrameFlags);
VideoFrame *F = FramePool.construct(IdeckLinkOutput, &R, PixelFormat, FrameFlags);
Building this on MSVS 2005, I receive the error:
error C2660: 'boost::object_pool<T>::construct' : function does not take 4 arguments
According to the documentation on the 'construct' method of object_pool, "ElementType must have a constructor matching ???; the number of parameters given must not exceed what is supported through pool_construct"
I've seen boost's page for the pool_construct, but I'm not too sure the direction I need to take. The build of boost that I have on my machine has both a pool_construct.m4, pool_construct.sh, pool_construct.bat, pool_construct.inc. It's a question of what do I do with these example files within my own project? Would I create my own variation of pool_construct.inc and include that in my own project? How would I add the file?
Any tips/recommendations would be much appreciated. Please note that I have installed gnu's m4.
zerodefect.