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

#include <idl.h>

Public Member Functions

 ~SymbolTable ()
 
bool Add (const std::string &name, T *e)
 
void Move (const std::string &oldname, const std::string &newname)
 
T * Lookup (const std::string &name) const
 

Data Fields

std::map< std::string, T * > dict
 
std::vector< T * > vec
 

Detailed Description

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

Definition at line 203 of file idl.h.

Constructor & Destructor Documentation

◆ ~SymbolTable()

template<typename T >
flatbuffers::SymbolTable< T >::~SymbolTable ( )
inline

Definition at line 206 of file idl.h.

207 {
208 for (auto it = vec.begin(); it != vec.end(); ++it)
209 {
210 delete *it;
211 }
212 }
std::vector< T * > vec
Definition idl.h:247

References flatbuffers::SymbolTable< T >::vec.

Member Function Documentation

◆ Add()

template<typename T >
bool flatbuffers::SymbolTable< T >::Add ( const std::string &  name,
T *  e 
)
inline

Definition at line 214 of file idl.h.

215 {
217 auto it = dict.find(name);
218 if (it != dict.end())
219 return true;
220 dict[name] = e;
221 return false;
222 }
std::map< std::string, T * > dict
Definition idl.h:246
void vector_emplace_back(std::vector< T > *vector, V &&data)

References flatbuffers::SymbolTable< T >::dict, flatbuffers::SymbolTable< T >::vec, and flatbuffers::vector_emplace_back().

◆ Lookup()

template<typename T >
T * flatbuffers::SymbolTable< T >::Lookup ( const std::string &  name) const
inline

Definition at line 239 of file idl.h.

240 {
241 auto it = dict.find(name);
242 return it == dict.end() ? nullptr : it->second;
243 }

References flatbuffers::SymbolTable< T >::dict.

◆ Move()

template<typename T >
void flatbuffers::SymbolTable< T >::Move ( const std::string &  oldname,
const std::string &  newname 
)
inline

Definition at line 224 of file idl.h.

225 {
226 auto it = dict.find(oldname);
227 if (it != dict.end())
228 {
229 auto obj = it->second;
230 dict.erase(it);
231 dict[newname] = obj;
232 }
233 else
234 {
235 FLATBUFFERS_ASSERT(false);
236 }
237 }
#define FLATBUFFERS_ASSERT
Definition base.h:37

References flatbuffers::SymbolTable< T >::dict, and FLATBUFFERS_ASSERT.

Field Documentation

◆ dict

template<typename T >
std::map<std::string, T *> flatbuffers::SymbolTable< T >::dict

◆ vec

template<typename T >
std::vector<T *> flatbuffers::SymbolTable< T >::vec

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