ONE - On-device Neural Engine
Loading...
Searching...
No Matches
flatbuffers::DetachedBuffer Class Reference

#include <flatbuffers.h>

Collaboration diagram for flatbuffers::DetachedBuffer:

Public Member Functions

 DetachedBuffer ()
 
 DetachedBuffer (Allocator *allocator, bool own_allocator, uint8_t *buf, size_t reserved, uint8_t *cur, size_t sz)
 
 DetachedBuffer (DetachedBuffer &&other)
 
DetachedBufferoperator= (DetachedBuffer &&other)
 
 ~DetachedBuffer ()
 
const uint8_t * data () const
 
uint8_t * data ()
 
size_t size () const
 
 FLATBUFFERS_DELETE_FUNC (DetachedBuffer(const DetachedBuffer &other))
 
 FLATBUFFERS_DELETE_FUNC (DetachedBuffer &operator=(const DetachedBuffer &other))
 

Protected Member Functions

void destroy ()
 
void reset ()
 

Protected Attributes

Allocatorallocator_
 
bool own_allocator_
 
uint8_t * buf_
 
size_t reserved_
 
uint8_t * cur_
 
size_t size_
 

Detailed Description

Definition at line 756 of file flatbuffers.h.

Constructor & Destructor Documentation

◆ DetachedBuffer() [1/3]

flatbuffers::DetachedBuffer::DetachedBuffer ( )
inline

Definition at line 759 of file flatbuffers.h.

◆ DetachedBuffer() [2/3]

flatbuffers::DetachedBuffer::DetachedBuffer ( Allocator allocator,
bool  own_allocator,
uint8_t *  buf,
size_t  reserved,
uint8_t *  cur,
size_t  sz 
)
inline

Definition at line 765 of file flatbuffers.h.

767 : allocator_(allocator), own_allocator_(own_allocator), buf_(buf), reserved_(reserved),
768 cur_(cur), size_(sz)
769 {
770 }

◆ DetachedBuffer() [3/3]

flatbuffers::DetachedBuffer::DetachedBuffer ( DetachedBuffer &&  other)
inline

Definition at line 774 of file flatbuffers.h.

775 : allocator_(other.allocator_), own_allocator_(other.own_allocator_), buf_(other.buf_),
776 reserved_(other.reserved_), cur_(other.cur_), size_(other.size_)
777 {
778 other.reset();
779 }

◆ ~DetachedBuffer()

flatbuffers::DetachedBuffer::~DetachedBuffer ( )
inline

Definition at line 805 of file flatbuffers.h.

References destroy().

Member Function Documentation

◆ data() [1/2]

uint8_t * flatbuffers::DetachedBuffer::data ( )
inline

Definition at line 809 of file flatbuffers.h.

809{ return cur_; }

References cur_.

◆ data() [2/2]

const uint8_t * flatbuffers::DetachedBuffer::data ( ) const
inline

Definition at line 807 of file flatbuffers.h.

807{ return cur_; }

References cur_.

◆ destroy()

void flatbuffers::DetachedBuffer::destroy ( )
inlineprotected

Definition at line 847 of file flatbuffers.h.

848 {
849 if (buf_)
852 {
853 delete allocator_;
854 }
855 reset();
856 }
void Deallocate(Allocator *allocator, uint8_t *p, size_t size)

References allocator_, buf_, flatbuffers::Deallocate(), own_allocator_, reserved_, and reset().

Referenced by operator=(), and ~DetachedBuffer().

◆ FLATBUFFERS_DELETE_FUNC() [1/2]

flatbuffers::DetachedBuffer::FLATBUFFERS_DELETE_FUNC ( DetachedBuffer operator = (const DetachedBuffer &other))

◆ FLATBUFFERS_DELETE_FUNC() [2/2]

flatbuffers::DetachedBuffer::FLATBUFFERS_DELETE_FUNC ( DetachedBuffer(const DetachedBuffer &other)  )

◆ operator=()

DetachedBuffer & flatbuffers::DetachedBuffer::operator= ( DetachedBuffer &&  other)
inline

Definition at line 784 of file flatbuffers.h.

785 {
786 if (this == &other)
787 return *this;
788
789 destroy();
790
791 allocator_ = other.allocator_;
792 own_allocator_ = other.own_allocator_;
793 buf_ = other.buf_;
794 reserved_ = other.reserved_;
795 cur_ = other.cur_;
796 size_ = other.size_;
797
798 other.reset();
799
800 return *this;
801 }

References allocator_, buf_, cur_, destroy(), own_allocator_, reserved_, and size_.

◆ reset()

void flatbuffers::DetachedBuffer::reset ( )
inlineprotected

Definition at line 858 of file flatbuffers.h.

859 {
860 allocator_ = nullptr;
861 own_allocator_ = false;
862 buf_ = nullptr;
863 reserved_ = 0;
864 cur_ = nullptr;
865 size_ = 0;
866 }

References allocator_, buf_, cur_, own_allocator_, reserved_, and size_.

Referenced by destroy().

◆ size()

size_t flatbuffers::DetachedBuffer::size ( ) const
inline

Definition at line 811 of file flatbuffers.h.

811{ return size_; }

References size_.

Field Documentation

◆ allocator_

Allocator* flatbuffers::DetachedBuffer::allocator_
protected

Definition at line 840 of file flatbuffers.h.

Referenced by destroy(), operator=(), and reset().

◆ buf_

uint8_t* flatbuffers::DetachedBuffer::buf_
protected

Definition at line 842 of file flatbuffers.h.

Referenced by destroy(), operator=(), and reset().

◆ cur_

uint8_t* flatbuffers::DetachedBuffer::cur_
protected

Definition at line 844 of file flatbuffers.h.

Referenced by data(), data(), operator=(), and reset().

◆ own_allocator_

bool flatbuffers::DetachedBuffer::own_allocator_
protected

Definition at line 841 of file flatbuffers.h.

Referenced by destroy(), operator=(), and reset().

◆ reserved_

size_t flatbuffers::DetachedBuffer::reserved_
protected

Definition at line 843 of file flatbuffers.h.

Referenced by destroy(), operator=(), and reset().

◆ size_

size_t flatbuffers::DetachedBuffer::size_
protected

Definition at line 845 of file flatbuffers.h.

Referenced by operator=(), reset(), and size().


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