vdr-plugin-softhddevice-drm-gles 1.4.0
pool.h
Go to the documentation of this file.
1
18#ifndef __SOFTHDPOOL_H
19#define __SOFTHDPOOL_H
20
21#include <vector>
22#include <memory>
23
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
40#endif
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