| 12 | namespace aimrt::util { |
| 13 | |
| 14 | class BufferArrayAllocatorRef { |
| 15 | public: |
| 16 | BufferArrayAllocatorRef() = default; |
| 17 | explicit BufferArrayAllocatorRef(const aimrt_buffer_array_allocator_t* base_ptr) |
| 18 | : base_ptr_(base_ptr) {} |
| 19 | ~BufferArrayAllocatorRef() = default; |
| 20 | |
| 21 | explicit operator bool() const { return (base_ptr_ != nullptr); } |
| 22 | |
| 23 | const aimrt_buffer_array_allocator_t* NativeHandle() const { |
| 24 | return base_ptr_; |
| 25 | } |
| 26 | |
| 27 | void Reserve(aimrt_buffer_array_t* buffer_array, size_t new_cap) { |
| 28 | base_ptr_->reserve(base_ptr_->impl, buffer_array, new_cap); |
| 29 | } |
| 30 | |
| 31 | aimrt_buffer_t Allocate(aimrt_buffer_array_t* buffer_array, size_t size) { |
| 32 | return base_ptr_->allocate(base_ptr_->impl, buffer_array, size); |
| 33 | } |
| 34 | |
| 35 | void Release(aimrt_buffer_array_t* buffer_array) { |
| 36 | base_ptr_->release(base_ptr_->impl, buffer_array); |
| 37 | } |
| 38 | |
| 39 | private: |
| 40 | const aimrt_buffer_array_allocator_t* base_ptr_ = nullptr; |
| 41 | }; |
| 42 | |
| 43 | class BufferArray { |
| 44 | public: |
no outgoing calls
no test coverage detected