This snippet illustrates how to use object pool. Objects pool shares the object instances for more efficiently using memory management. Objects instance in pool are never recreated.
// Creation a pool. Maximum of instances in the pool is 1000 and initially will be created is 5. auxutils::ept::ObjectPool* poPool = new auxutils::ept::ObjectPool ( 1000, 5 ); // Get an instance from pool MyClass* poInstance = poPool->getObject(); // Return the instance to pool poPool->returnObject(poInstance); // Delete pool delete poPool;