Skip to content

Commit 372cd7e

Browse files
committed
ObjectPool: fixed comments and hid one method under DEBUG
1 parent 616d71b commit 372cd7e

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

scripts/util/ObjectPool.asc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ int ObjectPool::GetTotalNum() {
166166
return this._numUsed;
167167
}
168168

169+
#ifdef DEBUG
169170
//===========================================================================
170171
//
171172
// ObjectPool::GetPoolSize()
@@ -174,3 +175,4 @@ int ObjectPool::GetTotalNum() {
174175
int ObjectPool::GetPoolSize() {
175176
return this._capacity;
176177
}
178+
#endif // DEBUG

scripts/util/ObjectPool.ash

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,34 @@
3636
#ifndef __OBJECTPOOL_MODULE__
3737
#define __OBJECTPOOL_MODULE__
3838

39-
#define OBJECTPOOL_VERSION_00_01_00_00
39+
#define OBJECTPOOL_VERSION_00_01_00_01
4040

4141
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.
4444
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.
4646
import void RemoveObjects(int from, int to);
47-
// Removes all IDs.
47+
/// Removes all IDs.
4848
import void RemoveAll();
4949

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.
5151
import int Acquire();
52-
// Marks given ID as "free".
52+
/// Marks given ID as "free".
5353
import void Release(int id);
54-
// Marks all the known IDs as "free".
54+
/// Marks all the known IDs as "free".
5555
import void ReleaseAll();
5656

57-
// Gets number of acquired ("used") IDs
57+
/// Gets number of acquired ("used") IDs
5858
import int GetAcquiredNum();
59-
// Gets number of available free IDs
59+
/// Gets number of available free IDs
6060
import int GetFreeNum();
61-
// Gets total number of registered IDs
61+
/// Gets total number of registered IDs
6262
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.
6465
import int GetPoolSize();
66+
#endif
6567

6668
protected int _capacity;
6769
protected int _numUsed;

0 commit comments

Comments
 (0)