1 /*========================== begin_copyright_notice ============================
2 
3 Copyright (C) 2017-2021 Intel Corporation
4 
5 SPDX-License-Identifier: MIT
6 
7 ============================= end_copyright_notice ===========================*/
8 
9 #include "cif/builtins/memory/buffer/buffer.h"
10 #include "cif/builtins/memory/buffer/impl/buffer_impl.h"
11 
12 #include "cif/macros/enable.h"
13 
14 namespace CIF{
15 
16 namespace Builtins{
17 
SetAllocator(AllocatorT allocator,DeallocatorT deallocator,ReallocatorT reallocator)18 void CIF_GET_INTERFACE_CLASS(Buffer, 1)::SetAllocator(AllocatorT allocator, DeallocatorT deallocator, ReallocatorT reallocator){
19     CIF_GET_PIMPL()->SetAllocator(allocator, deallocator, reallocator);
20 }
21 
SetUnderlyingStorage(void * memory,size_t size,DeallocatorT deallocator)22 void CIF_GET_INTERFACE_CLASS(Buffer, 1)::SetUnderlyingStorage(void *memory, size_t size, DeallocatorT deallocator){
23     CIF_GET_PIMPL()->SetUnderlyingStorage(memory, size, deallocator);
24 }
25 
SetUnderlyingStorage(const void * memory,size_t size)26 void CIF_GET_INTERFACE_CLASS(Buffer, 1)::SetUnderlyingStorage(const void *memory, size_t size){
27     CIF_GET_PIMPL()->SetUnderlyingStorage(memory, size);
28 }
29 
DetachAllocation()30 void *CIF_GET_INTERFACE_CLASS(Buffer, 1)::DetachAllocation(){
31     return CIF_GET_PIMPL()->DetachAllocation();
32 }
33 
GetMemoryRaw() const34 const void *CIF_GET_INTERFACE_CLASS(Buffer, 1)::GetMemoryRaw() const{
35     return CIF_GET_PIMPL()->GetMemoryRaw();
36 }
37 
GetMemoryRawWriteable()38 void *CIF_GET_INTERFACE_CLASS(Buffer, 1)::GetMemoryRawWriteable(){
39     return CIF_GET_PIMPL()->GetMemoryRawWriteable();
40 }
41 
GetSizeRaw() const42 size_t CIF_GET_INTERFACE_CLASS(Buffer, 1)::GetSizeRaw() const{
43     return CIF_GET_PIMPL()->GetSizeRaw();
44 }
45 
GetCapacityRaw() const46 size_t CIF_GET_INTERFACE_CLASS(Buffer, 1)::GetCapacityRaw() const{
47     return CIF_GET_PIMPL()->GetCapacityRaw();
48 }
49 
Resize(size_t newSize)50 bool CIF_GET_INTERFACE_CLASS(Buffer, 1)::Resize(size_t newSize){
51     return CIF_GET_PIMPL()->Resize(newSize);
52 }
53 
Reserve(size_t newCapacity)54 bool CIF_GET_INTERFACE_CLASS(Buffer, 1)::Reserve(size_t newCapacity){
55     return CIF_GET_PIMPL()->Reserve(newCapacity);
56 }
57 
Clear()58 void CIF_GET_INTERFACE_CLASS(Buffer, 1)::Clear(){
59     CIF_GET_PIMPL()->Clear();
60 }
61 
Deallocate()62 void CIF_GET_INTERFACE_CLASS(Buffer, 1)::Deallocate(){
63     CIF_GET_PIMPL()->Deallocate();
64 }
65 
AlignUp(uint32_t alignment)66 bool CIF_GET_INTERFACE_CLASS(Buffer, 1)::AlignUp(uint32_t alignment){
67     return CIF_GET_PIMPL()->AlignUp(alignment);
68 }
69 
PushBackRawBytes(const void * newData,size_t size)70 bool CIF_GET_INTERFACE_CLASS(Buffer, 1)::PushBackRawBytes(const void *newData, size_t size){
71     return CIF_GET_PIMPL()->PushBackRawBytes(newData, size);
72 }
73 
IsConst() const74 bool CIF_GET_INTERFACE_CLASS(Buffer, 1)::IsConst()const{
75     return CIF_GET_PIMPL()->IsConst();
76 }
77 
78 }
79 
80 }
81 
82 #include "cif/macros/disable.h"
83