ONE - On-device Neural Engine
Loading...
Searching...
No Matches
flatbuffers::EnumDef Struct Reference

#include <idl.h>

Collaboration diagram for flatbuffers::EnumDef:

Public Member Functions

 EnumDef ()
 
Offset< reflection::Enum > Serialize (FlatBufferBuilder *builder, const Parser &parser) const
 
bool Deserialize (Parser &parser, const reflection::Enum *values)
 
template<typename T >
void ChangeEnumValue (EnumVal *ev, T new_val)
 
void SortByValue ()
 
void RemoveDuplicates ()
 
std::string AllFlags () const
 
const EnumValMinValue () const
 
const EnumValMaxValue () const
 
uint64_t Distance (const EnumVal *v1, const EnumVal *v2) const
 
uint64_t Distance () const
 
EnumValReverseLookup (int64_t enum_idx, bool skip_union_default=false) const
 
EnumValFindByValue (const std::string &constant) const
 
std::string ToString (const EnumVal &ev) const
 
size_t size () const
 
const std::vector< EnumVal * > & Vals () const
 
const EnumValLookup (const std::string &enum_name) const
 
- Public Member Functions inherited from flatbuffers::Definition
 Definition ()
 
flatbuffers::Offset< flatbuffers::Vector< flatbuffers::Offset< reflection::KeyValue > > > SerializeAttributes (FlatBufferBuilder *builder, const Parser &parser) const
 
bool DeserializeAttributes (Parser &parser, const Vector< Offset< reflection::KeyValue > > *attrs)
 

Data Fields

bool is_union
 
bool uses_multiple_type_instances
 
Type underlying_type
 
- Data Fields inherited from flatbuffers::Definition
std::string name
 
std::string file
 
std::vector< std::string > doc_comment
 
SymbolTable< Valueattributes
 
bool generated
 
Namespacedefined_namespace
 
uoffset_t serialized_location
 
int index
 
int refcount
 

Detailed Description

Definition at line 415 of file idl.h.

Constructor & Destructor Documentation

◆ EnumDef()

flatbuffers::EnumDef::EnumDef ( )
inline

Definition at line 417 of file idl.h.

417: is_union(false), uses_multiple_type_instances(false) {}
bool uses_multiple_type_instances
Definition idl.h:452

Member Function Documentation

◆ AllFlags()

std::string flatbuffers::EnumDef::AllFlags ( ) const

◆ ChangeEnumValue()

template<typename T >
void flatbuffers::EnumDef::ChangeEnumValue ( EnumVal ev,
new_val 
)

◆ Deserialize()

bool flatbuffers::EnumDef::Deserialize ( Parser parser,
const reflection::Enum *  values 
)

◆ Distance() [1/2]

uint64_t flatbuffers::EnumDef::Distance ( ) const
inline

Definition at line 433 of file idl.h.

433{ return Distance(MinValue(), MaxValue()); }
uint64_t Distance() const
Definition idl.h:433
const EnumVal * MaxValue() const
const EnumVal * MinValue() const

References Distance(), MaxValue(), and MinValue().

Referenced by Distance().

◆ Distance() [2/2]

uint64_t flatbuffers::EnumDef::Distance ( const EnumVal v1,
const EnumVal v2 
) const

◆ FindByValue()

EnumVal * flatbuffers::EnumDef::FindByValue ( const std::string &  constant) const

◆ Lookup()

const EnumVal * flatbuffers::EnumDef::Lookup ( const std::string &  enum_name) const
inline

Definition at line 447 of file idl.h.

447{ return vals.Lookup(enum_name); }

◆ MaxValue()

const EnumVal * flatbuffers::EnumDef::MaxValue ( ) const

Referenced by Distance().

◆ MinValue()

const EnumVal * flatbuffers::EnumDef::MinValue ( ) const

Referenced by Distance().

◆ RemoveDuplicates()

void flatbuffers::EnumDef::RemoveDuplicates ( )

◆ ReverseLookup()

EnumVal * flatbuffers::EnumDef::ReverseLookup ( int64_t  enum_idx,
bool  skip_union_default = false 
) const

◆ Serialize()

Offset< reflection::Enum > flatbuffers::EnumDef::Serialize ( FlatBufferBuilder builder,
const Parser parser 
) const

◆ size()

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

Definition at line 443 of file idl.h.

443{ return vals.vec.size(); }

◆ SortByValue()

void flatbuffers::EnumDef::SortByValue ( )

◆ ToString()

std::string flatbuffers::EnumDef::ToString ( const EnumVal ev) const
inline

Definition at line 438 of file idl.h.

439 {
440 return IsUInt64() ? NumToString(ev.GetAsUInt64()) : NumToString(ev.GetAsInt64());
441 }
std::string NumToString(T t)
Definition util.h:139

References flatbuffers::EnumVal::GetAsInt64(), flatbuffers::EnumVal::GetAsUInt64(), and flatbuffers::NumToString().

◆ Vals()

const std::vector< EnumVal * > & flatbuffers::EnumDef::Vals ( ) const
inline

Definition at line 445 of file idl.h.

445{ return vals.vec; }

Field Documentation

◆ is_union

bool flatbuffers::EnumDef::is_union

Definition at line 449 of file idl.h.

◆ underlying_type

Type flatbuffers::EnumDef::underlying_type

Definition at line 453 of file idl.h.

◆ uses_multiple_type_instances

bool flatbuffers::EnumDef::uses_multiple_type_instances

Definition at line 452 of file idl.h.


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