|
36 | 36 | #ifndef __OBJECTPOOL_MODULE__ |
37 | 37 | #define __OBJECTPOOL_MODULE__ |
38 | 38 |
|
39 | | -#define OBJECTPOOL_VERSION_00_01_00_00 |
| 39 | +#define OBJECTPOOL_VERSION_00_01_00_01 |
40 | 40 |
|
41 | 41 | struct ObjectPool { |
42 | | - // Adds a range of IDs into the list. You can keep adding more later and all the previous |
43 | | - // ones will be kept unless you call RemoveObjects or RemoveAll. |
| 42 | + /// Adds a range of IDs into the list. You can keep adding more later and all the previous |
| 43 | + /// ones will be kept unless you call RemoveObjects or RemoveAll. |
44 | 44 | import void AddObjects(int from, int to); |
45 | | - // Removes a range of IDs from the list. |
| 45 | + /// Removes a range of IDs from the list. |
46 | 46 | import void RemoveObjects(int from, int to); |
47 | | - // Removes all IDs. |
| 47 | + /// Removes all IDs. |
48 | 48 | import void RemoveAll(); |
49 | 49 |
|
50 | | - // Gives next free ID and marks it as "used". Returns -1 if no more free IDs are available. |
| 50 | + /// Gives next free ID and marks it as "used". Returns -1 if no more free IDs are available. |
51 | 51 | import int Acquire(); |
52 | | - // Marks given ID as "free". |
| 52 | + /// Marks given ID as "free". |
53 | 53 | import void Release(int id); |
54 | | - // Marks all the known IDs as "free". |
| 54 | + /// Marks all the known IDs as "free". |
55 | 55 | import void ReleaseAll(); |
56 | 56 |
|
57 | | - // Gets number of acquired ("used") IDs |
| 57 | + /// Gets number of acquired ("used") IDs |
58 | 58 | import int GetAcquiredNum(); |
59 | | - // Gets number of available free IDs |
| 59 | + /// Gets number of available free IDs |
60 | 60 | import int GetFreeNum(); |
61 | | - // Gets total number of registered IDs |
| 61 | + /// Gets total number of registered IDs |
62 | 62 | import int GetTotalNum(); |
63 | | - // Gets pool capacity (may include empty slots!). This is for test purposes only. |
| 63 | +#ifdef DEBUG |
| 64 | + /// Gets pool capacity (may include empty slots!). This is for test purposes only. |
64 | 65 | import int GetPoolSize(); |
| 66 | +#endif |
65 | 67 |
|
66 | 68 | protected int _capacity; |
67 | 69 | protected int _numUsed; |
|
0 commit comments