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
21
template
<
typename
T>
22
class
cPool
{
23
protected
:
24
std::vector<std::unique_ptr<T>>
buffer
;
25
size_t
currentIndex
= 0;
26
27
public
:
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
cPool
Pool Implementation Template Class.
Definition
pool.h:22
cPool::cPool
cPool(size_t size)
Definition
pool.h:28
cPool::buffer
std::vector< std::unique_ptr< T > > buffer
Definition
pool.h:24
cPool::currentIndex
size_t currentIndex
Definition
pool.h:25
vector
Definition
drmhdr.h:33
pool.h
Generated by
1.9.8