| 17 | { |
| 18 | public: |
| 19 | ObjectPool(int count, Factory const & f) : m_factory(f) |
| 20 | { |
| 21 | for (int i = 0; i < count; ++i) |
| 22 | { |
| 23 | T * novice = m_factory.GetNew(); |
| 24 | #if defined(DEBUG) || defined(LOG_OBJECT_POOL) |
| 25 | m_checkerSet.insert(novice); |
| 26 | #endif |
| 27 | m_pool.push_back(novice); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | ~ObjectPool() |
| 32 | { |