Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
Pool Class Reference

## Public Member Functions
| __init__ (self, free=None)
| __repr__ (self)
| add (self, item)
| checkin (self, item)
| checkout (self)
| cleanup (self, cleanupFunc=None)
| getNumItems (self)
| hasFree (self)
| isFree (self, item)
| isUsed (self, item)
| remove (self, item)
| reset (self)

## Static Public Attributes
| notify = DirectNotifyGlobal.directNotify.newCategory("Pool")

## Constructor & Destructor Documentation

## ◆ __init__()

__init__ | ( |  | self,
|  |  | free = None )

## Member Function Documentation

## ◆ __repr__()

__repr__ | ( |  | self | ) |

## ◆ add()

add | ( |  | self,
|  |  | item )

    Add an item to the free list.

## ◆ checkin()

checkin | ( |  | self,
|  |  | item )

    Put back a checked out item.
    Error if the item is not checked out.

## ◆ checkout()

checkout | ( |  | self | ) |

    Get an arbitrary item from the pool.

## ◆ cleanup()

cleanup | ( |  | self,
|  |  | cleanupFunc = None )

    Completely cleanup the pool and all of its objects.
    cleanupFunc will be called on every free and used item.

## ◆ getNumItems()

getNumItems | ( |  | self | ) |

    Returns the number of free items and the number of used items.

## ◆ hasFree()

hasFree | ( |  | self | ) |

    Returns true if there is at least one free item.

## ◆ isFree()

isFree | ( |  | self,
|  |  | item )

    Returns true if this item is free for check out.

## ◆ isUsed()

isUsed | ( |  | self,
|  |  | item )

    Returns true if this item has already been checked out.

## ◆ remove()

remove | ( |  | self,
|  |  | item )

    Remove an item. Error is flagged if the item is not in the pool.

## ◆ reset()

reset | ( |  | self | ) |

    Resets the pool so all items are free.

## Member Data Documentation

## ◆ notify

notify = DirectNotifyGlobal.directNotify.newCategory("Pool")
| static