vdr-plugin-softhddevice-drm-gles 1.6.2
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
24template <typename T>
25class cPool {
26protected:
27 std::vector<std::unique_ptr<T>> buffer;
28 size_t currentIndex = 0;
29
30public:
31 cPool(size_t size) {
32 buffer.reserve(size);
33
34 for (size_t i = 0; i < size; ++i) {
35 buffer.emplace_back(std::make_unique<T>());
36 }
37 }
38};
39
42#endif
Pool Implementation Template Class.
Definition pool.h:25
cPool(size_t size)
Definition pool.h:31
std::vector< std::unique_ptr< T > > buffer
Definition pool.h:27
size_t currentIndex
Definition pool.h:28