CrystalSpace

Public API Reference

csArrayCapacityLinear< Threshold > Class Template Reference
[Containers]

csArray capacity handler. More...

#include <csutil/array.h>

List of all members.

Public Member Functions

 csArrayCapacityLinear (const size_t x)
 Construct capacity handler with a given size_t parameter for the Threshold object.
size_t GetCapacity (size_t count) const
 Compute the capacity for a given number of items.
bool IsCapacityExcessive (size_t capacity, size_t count) const
 Return "true" if the given capacity is too large for the given count, that is, if GetCapacity() would return a value for count smaller than capacity.



 csArrayCapacityLinear (const Threshold &threshold)
 Construct capacity handler.
 csArrayCapacityLinear ()
 Construct capacity handler.

Detailed Description

template<typename Threshold = csArrayThresholdVariable>
class csArrayCapacityLinear< Threshold >

csArray capacity handler.

Different capacity handlers allow to realize different csArray internal growth behaviours, if needed. This default "linear" handler will result in array capacity growth to multiples of Threshold and works well enough in most cases.

Definition at line 312 of file array.h.


Constructor & Destructor Documentation

template<typename Threshold = csArrayThresholdVariable>
csArrayCapacityLinear< Threshold >::csArrayCapacityLinear (  )  [inline]

Construct capacity handler.

Definition at line 317 of file array.h.

template<typename Threshold = csArrayThresholdVariable>
csArrayCapacityLinear< Threshold >::csArrayCapacityLinear ( const Threshold &  threshold  )  [inline]

Construct capacity handler.

Definition at line 318 of file array.h.

template<typename Threshold = csArrayThresholdVariable>
csArrayCapacityLinear< Threshold >::csArrayCapacityLinear ( const size_t  x  )  [inline]

Construct capacity handler with a given size_t parameter for the Threshold object.

The exact meaning of x depends on the Threshold implementation.

Remarks:
Mostly for compatibility with existing code.

Definition at line 327 of file array.h.


Member Function Documentation

template<typename Threshold = csArrayThresholdVariable>
size_t csArrayCapacityLinear< Threshold >::GetCapacity ( size_t  count  )  const [inline]

Compute the capacity for a given number of items.

The capacity will commonly be larger than the actual count to reduce the number of memory allocations when pushing items onto an array.

Definition at line 345 of file array.h.

template<typename Threshold = csArrayThresholdVariable>
bool csArrayCapacityLinear< Threshold >::IsCapacityExcessive ( size_t  capacity,
size_t  count 
) const [inline]

Return "true" if the given capacity is too large for the given count, that is, if GetCapacity() would return a value for count smaller than capacity.

Definition at line 335 of file array.h.


The documentation for this class was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1