MCPcopy Create free account
hub / github.com/AimRT/AimRT / BufferArrayAllocatorRef

Class BufferArrayAllocatorRef

src/interface/aimrt_module_cpp_interface/util/buffer.h:14–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12namespace aimrt::util {
13
14class 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
43class BufferArray {
44 public:

Callers 3

InvokeMethod · 0.85
PublishMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected