vdr-plugin-softhddevice-drm-gles 1.6.4-d0291bb
pool.h
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-or-later
2
10#ifndef __SOFTHDPOOL_H
11#define __SOFTHDPOOL_H
12
13#include <memory>
14#include <vector>
15
21template <typename T>
22class cPool {
23protected:
24 std::vector<std::unique_ptr<T>> buffer;
25 size_t currentIndex = 0;
26
27public:
28 cPool(size_t size) {
29 buffer.reserve(size);
30
31 for (size_t i = 0; i < size; ++i) {
32 buffer.emplace_back(std::make_unique<T>());
33 }
34 }
35};
36
37#endif
Pool Implementation Template Class.
Definition pool.h:22
cPool(size_t size)
Definition pool.h:28
std::vector< std::unique_ptr< T > > buffer
Definition pool.h:24
size_t currentIndex
Definition pool.h:25