Rudiments
resourcepool.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_RESOURCEPOOL_H
5#define RUDIMENTS_RESOURCEPOOL_H
6
7#include <rudiments/private/resourcepoolincludes.h>
8
13template <class valuetype>
15 public:
18
21 virtual ~resourcepool();
22
27 void setMin(uint64_t min);
28
31 uint64_t getMin();
32
37 void setMax(uint64_t max);
38
41 uint64_t getMax();
42
47 void setGrowBy(uint64_t growby);
48
51 uint64_t getGrowBy();
52
57 bool create();
58
63 bool clear();
64
69 bool reset();
70
75
80
84 void setMutex(threadmutex *mtx);
85
89
93
94 #include <rudiments/private/resourcepool.h>
95};
96
97#include <rudiments/private/resourcepoolinlines.h>
98
99#endif
Definition avltree.h:11
Definition resourcepool.h:14
bool returnResource(valuetype *resource)
Definition resourcepoolinlines.h:221
void setGrowBy(uint64_t growby)
Definition resourcepoolinlines.h:50
virtual ~resourcepool()
Definition resourcepoolinlines.h:17
bool clear()
Definition resourcepoolinlines.h:96
void setMutex(threadmutex *mtx)
Definition resourcepoolinlines.h:270
uint64_t getMax()
Definition resourcepoolinlines.h:44
uint64_t getAvailableOnDemandResourceCount()
Definition resourcepoolinlines.h:283
uint64_t getGrowBy()
Definition resourcepoolinlines.h:56
bool reset()
Definition resourcepoolinlines.h:114
resourcepool()
Definition resourcepoolinlines.h:9
bool create()
Definition resourcepoolinlines.h:62
uint64_t getMin()
Definition resourcepoolinlines.h:32
valuetype * borrowResource()
Definition resourcepoolinlines.h:150
void setMax(uint64_t max)
Definition resourcepoolinlines.h:38
void setMin(uint64_t min)
Definition resourcepoolinlines.h:23
uint64_t getAvailableInitialResourceCount()
Definition resourcepoolinlines.h:276
Definition threadmutex.h:11