ONE - On-device Neural Engine
Loading...
Searching...
No Matches
flexbuffers::TypedVector Class Reference

#include <flexbuffers.h>

Collaboration diagram for flexbuffers::TypedVector:

Public Member Functions

 TypedVector (const uint8_t *data, uint8_t byte_width, Type element_type)
 
Reference operator[] (size_t i) const
 
bool IsTheEmptyVector () const
 
Type ElementType ()
 
- Public Member Functions inherited from flexbuffers::Sized
 Sized (const uint8_t *data, uint8_t byte_width)
 
 Sized (const uint8_t *data, uint8_t byte_width, size_t sz)
 
size_t size () const
 
size_t read_size () const
 
- Public Member Functions inherited from flexbuffers::Object
 Object (const uint8_t *data, uint8_t byte_width)
 

Static Public Member Functions

static TypedVector EmptyTypedVector ()
 

Data Fields

friend Reference
 

Additional Inherited Members

- Protected Attributes inherited from flexbuffers::Sized
size_t size_
 
- Protected Attributes inherited from flexbuffers::Object
const uint8_t * data_
 
uint8_t byte_width_
 

Detailed Description

Definition at line 292 of file flexbuffers.h.

Constructor & Destructor Documentation

◆ TypedVector()

flexbuffers::TypedVector::TypedVector ( const uint8_t *  data,
uint8_t  byte_width,
Type  element_type 
)
inline

Definition at line 295 of file flexbuffers.h.

296 : Sized(data, byte_width), type_(element_type)
297 {
298 }
Sized(const uint8_t *data, uint8_t byte_width)

Member Function Documentation

◆ ElementType()

Type flexbuffers::TypedVector::ElementType ( )
inline

Definition at line 309 of file flexbuffers.h.

309{ return type_; }

◆ EmptyTypedVector()

static TypedVector flexbuffers::TypedVector::EmptyTypedVector ( )
inlinestatic

Definition at line 302 of file flexbuffers.h.

303 {
304 static const uint8_t empty_typed_vector[] = {0 /*len*/};
305 return TypedVector(empty_typed_vector + 1, 1, FBT_INT);
306 }
TypedVector(const uint8_t *data, uint8_t byte_width, Type element_type)

References flexbuffers::FBT_INT.

Referenced by flexbuffers::Reference::AsTypedVector(), and IsTheEmptyVector().

◆ IsTheEmptyVector()

bool flexbuffers::TypedVector::IsTheEmptyVector ( ) const
inline

Definition at line 307 of file flexbuffers.h.

const uint8_t * data_
static TypedVector EmptyTypedVector()

References flexbuffers::Object::data_, and EmptyTypedVector().

◆ operator[]()

Reference flexbuffers::TypedVector::operator[] ( size_t  i) const
inline

Definition at line 952 of file flexbuffers.h.

953{
954 auto len = size();
955 if (i >= len)
956 return Reference(nullptr, 1, NullPackedType());
957 auto elem = data_ + i * byte_width_;
958 return Reference(elem, byte_width_, 1, type_);
959}
size_t size() const
uint8_t NullPackedType()

References flexbuffers::Object::byte_width_, flexbuffers::Object::data_, flexbuffers::NullPackedType(), Reference, and flexbuffers::Sized::size().

Field Documentation

◆ Reference

friend flexbuffers::TypedVector::Reference

Definition at line 311 of file flexbuffers.h.

Referenced by operator[]().


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