ObjectPool/src/dorkbox/objectPool/BoundedPoolObject.kt

28 lines
911 B
Kotlin
Raw Permalink Normal View History

2020-10-20 00:57:18 +02:00
/*
2023-09-06 18:37:06 +02:00
* Copyright 2023 dorkbox, llc
2020-10-20 00:57:18 +02:00
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
2020-10-16 17:36:48 +02:00
package dorkbox.objectPool
2020-10-20 00:57:18 +02:00
/**
* @author Abinav Janakiraman
2023-09-06 18:37:06 +02:00
* @author dorkbox, llc
2020-10-20 00:57:18 +02:00
*/
2023-09-06 18:37:06 +02:00
abstract class BoundedPoolObject<T: Any>: PoolObject<T>() {
2020-10-16 17:36:48 +02:00
/**
* Called when an object is removed from the pool. Useful for logging how many objects are being removed
*/
2022-04-03 15:04:14 +02:00
open fun onRemove(`object`: T) {}
2020-10-20 00:57:18 +02:00
}