ONE - On-device Neural Engine
Loading...
Searching...
No Matches
flatbuffers::Vector< T > Class Template Reference

#include <flatbuffers.h>

Public Types

typedef VectorIterator< T, typename IndirectHelper< T >::mutable_return_typeiterator
 
typedef VectorIterator< T, typename IndirectHelper< T >::return_typeconst_iterator
 
typedef VectorReverseIterator< iteratorreverse_iterator
 
typedef VectorReverseIterator< const_iteratorconst_reverse_iterator
 
typedef IndirectHelper< T >::return_type return_type
 
typedef IndirectHelper< T >::mutable_return_type mutable_return_type
 
typedef return_type value_type
 

Public Member Functions

uoffset_t size () const
 
 FLATBUFFERS_ATTRIBUTE (deprecated("use size() instead")) uoffset_t Length() const
 
return_type Get (uoffset_t i) const
 
return_type operator[] (uoffset_t i) const
 
template<typename E >
GetEnum (uoffset_t i) const
 
template<typename U >
const U * GetAs (uoffset_t i) const
 
const StringGetAsString (uoffset_t i) const
 
const void * GetStructFromOffset (size_t o) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
void Mutate (uoffset_t i, const T &val)
 
void MutateOffset (uoffset_t i, const uint8_t *val)
 
mutable_return_type GetMutableObject (uoffset_t i) const
 
const uint8_t * Data () const
 
uint8_t * Data ()
 
const T * data () const
 
T * data ()
 
template<typename K >
return_type LookupByKey (K key) const
 

Protected Member Functions

 Vector ()
 

Protected Attributes

uoffset_t length_
 

Detailed Description

template<typename T>
class flatbuffers::Vector< T >

Definition at line 268 of file flatbuffers.h.

Member Typedef Documentation

◆ const_iterator

template<typename T >
typedef VectorIterator<T, typename IndirectHelper<T>::return_type> flatbuffers::Vector< T >::const_iterator

Definition at line 272 of file flatbuffers.h.

◆ const_reverse_iterator

template<typename T >
typedef VectorReverseIterator<const_iterator> flatbuffers::Vector< T >::const_reverse_iterator

Definition at line 274 of file flatbuffers.h.

◆ iterator

template<typename T >
typedef VectorIterator<T, typename IndirectHelper<T>::mutable_return_type> flatbuffers::Vector< T >::iterator

Definition at line 271 of file flatbuffers.h.

◆ mutable_return_type

template<typename T >
typedef IndirectHelper<T>::mutable_return_type flatbuffers::Vector< T >::mutable_return_type

Definition at line 283 of file flatbuffers.h.

◆ return_type

template<typename T >
typedef IndirectHelper<T>::return_type flatbuffers::Vector< T >::return_type

Definition at line 282 of file flatbuffers.h.

◆ reverse_iterator

template<typename T >
typedef VectorReverseIterator<iterator> flatbuffers::Vector< T >::reverse_iterator

Definition at line 273 of file flatbuffers.h.

◆ value_type

template<typename T >
typedef return_type flatbuffers::Vector< T >::value_type

Definition at line 284 of file flatbuffers.h.

Constructor & Destructor Documentation

◆ Vector()

template<typename T >
flatbuffers::Vector< T >::Vector ( )
protected

Member Function Documentation

◆ begin() [1/2]

template<typename T >
iterator flatbuffers::Vector< T >::begin ( )
inline

Definition at line 315 of file flatbuffers.h.

315{ return iterator(Data(), 0); }
VectorIterator< T, typename IndirectHelper< T >::mutable_return_type > iterator
const uint8_t * Data() const

References flatbuffers::Vector< T >::Data().

Referenced by tflite2circle::Offset< T >::build(), flatbuffers::Vector< T >::cbegin(), flatbuffers::Vector< T >::rend(), and flatbuffers::Vector< T >::rend().

◆ begin() [2/2]

template<typename T >
const_iterator flatbuffers::Vector< T >::begin ( ) const
inline

Definition at line 316 of file flatbuffers.h.

316{ return const_iterator(Data(), 0); }
VectorIterator< T, typename IndirectHelper< T >::return_type > const_iterator

References flatbuffers::Vector< T >::Data().

◆ cbegin()

template<typename T >
const_iterator flatbuffers::Vector< T >::cbegin ( ) const
inline

Definition at line 327 of file flatbuffers.h.

327{ return begin(); }

References flatbuffers::Vector< T >::begin().

◆ cend()

template<typename T >
const_iterator flatbuffers::Vector< T >::cend ( ) const
inline

Definition at line 329 of file flatbuffers.h.

329{ return end(); }

References flatbuffers::Vector< T >::end().

◆ crbegin()

template<typename T >
const_reverse_iterator flatbuffers::Vector< T >::crbegin ( ) const
inline

Definition at line 331 of file flatbuffers.h.

331{ return rbegin(); }
reverse_iterator rbegin()

References flatbuffers::Vector< T >::rbegin().

◆ crend()

template<typename T >
const_reverse_iterator flatbuffers::Vector< T >::crend ( ) const
inline

Definition at line 333 of file flatbuffers.h.

333{ return rend(); }
reverse_iterator rend()

References flatbuffers::Vector< T >::rend().

◆ Data() [1/2]

template<typename T >
uint8_t * flatbuffers::Vector< T >::Data ( )
inline

Definition at line 363 of file flatbuffers.h.

363{ return reinterpret_cast<uint8_t *>(&length_ + 1); }

References flatbuffers::Vector< T >::length_.

◆ data() [1/2]

template<typename T >
T * flatbuffers::Vector< T >::data ( )
inline

Definition at line 367 of file flatbuffers.h.

367{ return reinterpret_cast<T *>(Data()); }

References flatbuffers::Vector< T >::Data().

◆ Data() [2/2]

◆ data() [2/2]

template<typename T >
const T * flatbuffers::Vector< T >::data ( ) const
inline

◆ end() [1/2]

◆ end() [2/2]

template<typename T >
const_iterator flatbuffers::Vector< T >::end ( ) const
inline

Definition at line 319 of file flatbuffers.h.

319{ return const_iterator(Data(), size()); }

References flatbuffers::Vector< T >::Data(), and flatbuffers::Vector< T >::size().

◆ FLATBUFFERS_ATTRIBUTE()

template<typename T >
flatbuffers::Vector< T >::FLATBUFFERS_ATTRIBUTE ( deprecated("use size() instead")  ) const
inline

Definition at line 279 of file flatbuffers.h.

280 { return size(); }

References flatbuffers::Vector< T >::size().

◆ Get()

◆ GetAs()

template<typename T >
template<typename U >
const U * flatbuffers::Vector< T >::GetAs ( uoffset_t  i) const
inline

Definition at line 301 of file flatbuffers.h.

302 {
303 return reinterpret_cast<const U *>(Get(i));
304 }
return_type Get(uoffset_t i) const

References flatbuffers::Vector< T >::Get().

◆ GetAsString()

template<typename T >
const String * flatbuffers::Vector< T >::GetAsString ( uoffset_t  i) const
inline

Definition at line 308 of file flatbuffers.h.

308{ return reinterpret_cast<const String *>(Get(i)); }

References flatbuffers::Vector< T >::Get().

◆ GetEnum()

template<typename T >
template<typename E >
E flatbuffers::Vector< T >::GetEnum ( uoffset_t  i) const
inline

Definition at line 297 of file flatbuffers.h.

297{ return static_cast<E>(Get(i)); }

References flatbuffers::Vector< T >::Get().

◆ GetMutableObject()

template<typename T >
mutable_return_type flatbuffers::Vector< T >::GetMutableObject ( uoffset_t  i) const
inline

Definition at line 354 of file flatbuffers.h.

355 {
357 return const_cast<mutable_return_type>(IndirectHelper<T>::Read(Data(), i));
358 }
IndirectHelper< T >::mutable_return_type mutable_return_type

References flatbuffers::Vector< T >::Data(), FLATBUFFERS_ASSERT, flatbuffers::IndirectHelper< T >::Read(), and flatbuffers::Vector< T >::size().

◆ GetStructFromOffset()

template<typename T >
const void * flatbuffers::Vector< T >::GetStructFromOffset ( size_t  o) const
inline

Definition at line 310 of file flatbuffers.h.

311 {
312 return reinterpret_cast<const void *>(Data() + o);
313 }

References flatbuffers::Vector< T >::Data().

◆ LookupByKey()

template<typename T >
template<typename K >
return_type flatbuffers::Vector< T >::LookupByKey ( key) const
inline

Definition at line 369 of file flatbuffers.h.

370 {
371 void *search_result =
372 std::bsearch(&key, Data(), size(), IndirectHelper<T>::element_stride, KeyCompare<K>);
373
374 if (!search_result)
375 {
376 return nullptr; // Key not found.
377 }
378
379 const uint8_t *element = reinterpret_cast<const uint8_t *>(search_result);
380
381 return IndirectHelper<T>::Read(element, 0);
382 }
static const size_t element_stride

References flatbuffers::Vector< T >::Data(), flatbuffers::IndirectHelper< T >::Read(), and flatbuffers::Vector< T >::size().

◆ Mutate()

template<typename T >
void flatbuffers::Vector< T >::Mutate ( uoffset_t  i,
const T &  val 
)
inline

Definition at line 337 of file flatbuffers.h.

338 {
340 WriteScalar(data() + i, val);
341 }
const T * data() const

References flatbuffers::Vector< T >::data(), FLATBUFFERS_ASSERT, and flatbuffers::Vector< T >::size().

◆ MutateOffset()

template<typename T >
void flatbuffers::Vector< T >::MutateOffset ( uoffset_t  i,
const uint8_t *  val 
)
inline

Definition at line 346 of file flatbuffers.h.

347 {
349 static_assert(sizeof(T) == sizeof(uoffset_t), "Unrelated types");
350 WriteScalar(data() + i, static_cast<uoffset_t>(val - (Data() + i * sizeof(uoffset_t))));
351 }

References flatbuffers::Vector< T >::Data(), flatbuffers::Vector< T >::data(), FLATBUFFERS_ASSERT, and flatbuffers::Vector< T >::size().

◆ operator[]()

template<typename T >
return_type flatbuffers::Vector< T >::operator[] ( uoffset_t  i) const
inline

Definition at line 292 of file flatbuffers.h.

292{ return Get(i); }

References flatbuffers::Vector< T >::Get().

◆ rbegin() [1/2]

template<typename T >
reverse_iterator flatbuffers::Vector< T >::rbegin ( )
inline

Definition at line 321 of file flatbuffers.h.

321{ return reverse_iterator(end()); }
VectorReverseIterator< iterator > reverse_iterator

References flatbuffers::Vector< T >::end().

Referenced by flatbuffers::Vector< T >::crbegin().

◆ rbegin() [2/2]

template<typename T >
const_reverse_iterator flatbuffers::Vector< T >::rbegin ( ) const
inline

Definition at line 322 of file flatbuffers.h.

322{ return const_reverse_iterator(end()); }
VectorReverseIterator< const_iterator > const_reverse_iterator

References flatbuffers::Vector< T >::end().

◆ rend() [1/2]

template<typename T >
reverse_iterator flatbuffers::Vector< T >::rend ( )
inline

Definition at line 324 of file flatbuffers.h.

324{ return reverse_iterator(begin()); }

References flatbuffers::Vector< T >::begin().

Referenced by flatbuffers::Vector< T >::crend().

◆ rend() [2/2]

template<typename T >
const_reverse_iterator flatbuffers::Vector< T >::rend ( ) const
inline

Definition at line 325 of file flatbuffers.h.

325{ return const_reverse_iterator(begin()); }

References flatbuffers::Vector< T >::begin().

◆ size()

template<typename T >
uoffset_t flatbuffers::Vector< T >::size ( ) const
inline

Definition at line 276 of file flatbuffers.h.

276{ return EndianScalar(length_); }

References flatbuffers::Vector< T >::length_.

Referenced by tflimport::as_index_vector(), circlechef::as_index_vector(), tflinspect::as_index_vector(), tflchef::as_index_vector(), tflread::as_index_vector(), tflimport::as_tensor_shape(), onert_micro::import::OMKernelConfiguration::configureKernels(), onert_micro::import::OMExecutionPlanCreator::createBackwardExecutionPlan(), onert_micro::import::OMExecutionPlanCreator::createExecutionPlan(), onert_micro::import::OMExecutionPlanCreator::createForwardExecutionPlan(), flatbuffers::Vector< T >::end(), flatbuffers::Vector< T >::end(), flatbuffers::Vector< T >::FLATBUFFERS_ATTRIBUTE(), flatbuffers::Vector< T >::Get(), flatbuffers::Vector< T >::GetMutableObject(), onert_micro::core::OMRuntimeGraph::getNumberOfOutputs(), onert_micro::execute::getQuantizedConvolutionMultiplers(), flatbuffers::Vector< T >::LookupByKey(), flatbuffers::Vector< T >::Mutate(), flatbuffers::Vector< T >::MutateOffset(), circlechef::CircleImport::num_subgraph(), mio::circle::Reader::num_subgraph(), tflinspect::Reader::num_subgraph(), tflchef::TFliteImport::num_subgraph(), tflread::Reader::num_subgraph(), flatbuffers::String::operator<(), circledump::operator<<(), tfldump::operator<<(), circledump::CustomOpPrinter::options(), tfldump::CustomOpPrinter::options(), flatbuffers::ResizeVector(), onert_micro::train::OMBackpropExecute::runBackward(), onert_micro::execute::OMKernelExecute::runForward(), circlechef::CircleImport::select_sub_graph(), tflchef::TFliteImport::select_sub_graph(), tflinspect::Reader::select_subgraph(), tflread::Reader::select_subgraph(), tflimport::TflBufferContext::TflBufferContext(), onert_micro::core::reader::OMTrainingConfigReader::validate(), and onert_micro::core::reader::OMWeightOnlyFormatReader::validate().

Field Documentation

◆ length_

template<typename T >
uoffset_t flatbuffers::Vector< T >::length_
protected

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