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

#include <flexbuffers.h>

Collaboration diagram for flexbuffers::FixedTypedVector:

Public Member Functions

 FixedTypedVector (const uint8_t *data, uint8_t byte_width, Type element_type, uint8_t len)
 
Reference operator[] (size_t i) const
 
bool IsTheEmptyFixedTypedVector () const
 
Type ElementType ()
 
uint8_t size ()
 
- Public Member Functions inherited from flexbuffers::Object
 Object (const uint8_t *data, uint8_t byte_width)
 

Static Public Member Functions

static FixedTypedVector EmptyFixedTypedVector ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 319 of file flexbuffers.h.

Constructor & Destructor Documentation

◆ FixedTypedVector()

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

Definition at line 322 of file flexbuffers.h.

323 : Object(data, byte_width), type_(element_type), len_(len)
324 {
325 }

Member Function Documentation

◆ ElementType()

Type flexbuffers::FixedTypedVector::ElementType ( )
inline

Definition at line 339 of file flexbuffers.h.

339{ return type_; }

◆ EmptyFixedTypedVector()

static FixedTypedVector flexbuffers::FixedTypedVector::EmptyFixedTypedVector ( )
inlinestatic

Definition at line 329 of file flexbuffers.h.

330 {
331 static const uint8_t fixed_empty_vector[] = {0 /* unused */};
332 return FixedTypedVector(fixed_empty_vector, 1, FBT_INT, 0);
333 }
FixedTypedVector(const uint8_t *data, uint8_t byte_width, Type element_type, uint8_t len)

References flexbuffers::FBT_INT.

Referenced by flexbuffers::Reference::AsFixedTypedVector(), and IsTheEmptyFixedTypedVector().

◆ IsTheEmptyFixedTypedVector()

bool flexbuffers::FixedTypedVector::IsTheEmptyFixedTypedVector ( ) const
inline

Definition at line 334 of file flexbuffers.h.

335 {
337 }
static FixedTypedVector EmptyFixedTypedVector()
const uint8_t * data_

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

◆ operator[]()

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

Definition at line 961 of file flexbuffers.h.

962{
963 if (i >= len_)
964 return Reference(nullptr, 1, NullPackedType());
965 auto elem = data_ + i * byte_width_;
966 return Reference(elem, byte_width_, 1, type_);
967}
uint8_t NullPackedType()

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

◆ size()

uint8_t flexbuffers::FixedTypedVector::size ( )
inline

Definition at line 340 of file flexbuffers.h.

340{ return len_; }

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