Lines Matching defs:capacity

337  * Common aspect for all objects that have a linear capacity.
340 /// \name Linear capacity interface
343 inline constexpr uint32_t capacity() const { return mCapacity; }
356 inline explicit _C2LinearCapacityAspect(size_t capacity) = delete;
359 inline explicit constexpr _C2LinearCapacityAspect(uint32_t capacity)
360 : mCapacity(capacity) { }
363 : mCapacity(parent == nullptr ? 0 : parent->capacity()) { }
371 * Aspect for objects that have a linear range inside a linear capacity.
388 // subrange of capacity [0, capacity] & [size, size + offset]
391 mOffset(c2_min(offset, capacity())),
392 mSize(c2_min(size, capacity() - mOffset)) {
398 : _C2LinearCapacityAspect(other.capacity()),
403 // parent capacity range [0, capacity]
407 mSize(capacity()) {
410 // subrange of parent capacity [0, capacity] & [size, size + offset]
413 mOffset(c2_min(offset, capacity())),
414 mSize(c2_min(size, capacity() - mOffset)) {
420 mOffset(c2_min(c2_max(offset, parent == nullptr ? 0 : parent->offset()), capacity())),
421 mSize(std::min(c2_min(size, parent == nullptr ? 0 : parent->size()), capacity() - mOffset)) {
428 c2_min(c2_max(offset, mOffset), capacity()) - mOffset,
429 c2_min(c2_min(size, mSize), capacity() - c2_min(c2_max(offset, mOffset), capacity())));
433 // invariants 0 <= mOffset <= mOffset + mSize <= capacity()
456 * Utility class for simple and safe capacity and range construction.
460 inline constexpr explicit C2LinearCapacity(size_t capacity)
461 : _C2LinearCapacityAspect(c2_min(capacity, std::numeric_limits<uint32_t>::max())) { }
483 * true if successful, which is equivalent to if 0 <= |offset| <= capacity().
489 if (offset > capacity()) {
504 * if 0 <= |size| <= capacity() - offset().
510 if (size > capacity() - mOffset) {
520 * be clamped to the buffer capacity.
526 (void)setOffset(c2_min(offset, capacity()));
531 * will be clamped to the buffer capacity (e.g. size is clamped to [0, capacity() - offset()]).
537 mSize = c2_min(size, capacity() - mOffset);
626 * Allocates a 1D allocation of given |capacity| and |usage|. If successful, the allocation is
629 * \param capacity the size of requested allocation (the allocation could be slightly
643 * \retval C2_BAD_VALUE capacity or usage are not supported (invalid) (caller error)
648 uint32_t capacity __unused, C2MemoryUsage usage __unused,
822 C2LinearAllocation(size_t capacity) : _C2LinearCapacityAspect(c2_min(capacity, UINT32_MAX)) {}
879 * Obtains a linear writeable block of given |capacity| and |usage|. If successful, the
882 * \param capacity the size of requested block.
893 * \retval C2_BAD_VALUE capacity or usage are not supported (invalid) (caller error)
898 uint32_t capacity __unused, C2MemoryUsage usage __unused,
905 * Obtains a circular writeable block of given |capacity| and |usage|. If successful, the
908 * \param capacity the size of requested circular block. (note: the size of the obtained
921 * \retval C2_BAD_VALUE capacity or usage are not supported (invalid) (caller error)
926 uint32_t capacity __unused, C2MemoryUsage usage __unused,
984 * \note capacity() is not meaningful for users of blocks; instead size() is the capacity of the
1030 * \param offset the start offset of the portion. \note This is clamped to the capacity of this
1118 * \param offset the start offset of the portion. \note This is clamped to the capacity of this
1444 * Interface for objects that have a width and height (planar capacity).
1447 /// \name Planar capacity interface
1606 * Returns a child planar section for |crop|, where the capacity represents this section.
1697 * Utility class for simple and safe planar capacity and section construction.
1802 * crop().height() is the capacity of the usable portion. Use and crop() if accessing the block