PxOpoolGetCurrentCapacity()

Return the current capacity of an object pool.

APPLIES TO

8.2.0

SYNOPSIS
PxUInt_t PxOpoolGetCurrentCapacity (PxOpool_t OpoolId);
ARGUMENTS
OpoolId

An object pool id

RETURN VALUES
  • The current capacity of the given object pool

ERROR CODES

PXERR_OPOOL_ILLOPOOL

OpoolId is not a valid object pool id

PXERR_GLOBAL_ILLEGAL_CORE

The requested object pool is not on the same core

DESCRIPTION

PxOpoolGetCurrentCapacity returns the current capacity in opool. This is the actual number of available objects only for real object pools. For virtual objects pools, it describes the number of objects that can be obtained from the object pool, provided that its source has sufficient capacity. If PxOpoolGetCurrentCapacity returns 0, either the object pool is empty or an error has occurred. Call PxGetError to see if an error occurred.

IMPLEMENTATION GUIDELINES
Before call
  • OpoolId must be a valid PXROS-HR object pool. The validity of OpoolId may be checked by the following macros:

    • PxOpoolIdIsValid() must be true.

    • PxOpoolIdGet() must not be _PXIllegalObjId.

    • PxOpoolIdError() must be PXERR_NOERROR otherwise the returned error code has to be interpreted (C).

After call
  • The function returns 0 if the given object pool is invalid. In this case PxGetError must be called to check which error has occurred. (F)

Best Practice
  • No restrictions.

SEE ALSO
USAGE
#include "pxdef.h"

PxUInt_t Cap = PxOpoolGetCurrentCapacity(OpoolId);