Public Member Functions | Private Attributes | List of all members
uavcan::LimitedPoolAllocator Class Reference

#include <dynamic_memory.hpp>

Inheritance diagram for uavcan::LimitedPoolAllocator:
Inheritance graph
[legend]

Public Member Functions

virtual void * allocate (std::size_t size)
 
virtual void deallocate (const void *ptr)
 
virtual uint16_t getBlockCapacity () const
 
 LimitedPoolAllocator (IPoolAllocator &allocator, std::size_t max_blocks)
 
- Public Member Functions inherited from uavcan::IPoolAllocator
virtual ~IPoolAllocator ()
 

Private Attributes

IPoolAllocatorallocator_
 
const uint16_t max_blocks_
 
uint16_t used_blocks_
 

Detailed Description

Limits the maximum number of blocks that can be allocated in a given allocator.

Definition at line 112 of file dynamic_memory.hpp.

Constructor & Destructor Documentation

◆ LimitedPoolAllocator()

uavcan::LimitedPoolAllocator::LimitedPoolAllocator ( IPoolAllocator allocator,
std::size_t  max_blocks 
)
inline

Definition at line 119 of file dynamic_memory.hpp.

Member Function Documentation

◆ allocate()

void * uavcan::LimitedPoolAllocator::allocate ( std::size_t  size)
virtual

Implements uavcan::IPoolAllocator.

Definition at line 12 of file uc_dynamic_memory.cpp.

◆ deallocate()

void uavcan::LimitedPoolAllocator::deallocate ( const void *  ptr)
virtual

Implements uavcan::IPoolAllocator.

Definition at line 25 of file uc_dynamic_memory.cpp.

◆ getBlockCapacity()

uint16_t uavcan::LimitedPoolAllocator::getBlockCapacity ( ) const
virtual

Returns the maximum number of blocks this allocator can allocate.

Implements uavcan::IPoolAllocator.

Definition at line 36 of file uc_dynamic_memory.cpp.

Member Data Documentation

◆ allocator_

IPoolAllocator& uavcan::LimitedPoolAllocator::allocator_
private

Definition at line 114 of file dynamic_memory.hpp.

◆ max_blocks_

const uint16_t uavcan::LimitedPoolAllocator::max_blocks_
private

Definition at line 115 of file dynamic_memory.hpp.

◆ used_blocks_

uint16_t uavcan::LimitedPoolAllocator::used_blocks_
private

Definition at line 116 of file dynamic_memory.hpp.


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


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04