Lines Matching refs:field

372 // Vector::data() assumes the vector elements start after the length field.
499 // of wether it is null or not (the field is not set).
839 void TrackField(voffset_t field, uoffset_t off) {
840 FieldLoc fl = { off, field };
844 // Like PushElement, but additionally tracks the field this represents.
845 template<typename T> void AddElement(voffset_t field, T e, T def) {
849 TrackField(field, off);
852 template<typename T> void AddOffset(voffset_t field, Offset<T> off) {
854 AddElement(field, ReferTo(off.o), static_cast<uoffset_t>(0));
857 template<typename T> void AddStruct(voffset_t field, const T *structptr) {
861 TrackField(field, GetSize());
864 void AddStructOffset(voffset_t field, uoffset_t off) {
865 TrackField(field, off);
921 // If this asserts, it means you've set a field twice.
958 // This checks a required field has been set in a given table that has
960 template<typename T> void Required(Offset<T> table, voffset_t field) {
963 bool ok = ReadScalar<voffset_t>(vtable_ptr + field) != 0;
964 // If this fails, the caller will show what field needs to be set.
1328 /// @brief Finish a buffer with a 32 bit size field pre-fixed (size of the
1329 /// buffer following the size field). These buffers are NOT compatible
1526 // Check we can read the size field.
1680 // This gets the field offset for any of the functions below it, or 0
1681 // if the field was not present.
1682 voffset_t GetOptionalFieldOffset(voffset_t field) const {
1687 // If the field we're accessing is outside the vtable, we're reading older
1689 return field < vtsize ? ReadScalar<voffset_t>(vtable + field) : 0;
1692 template<typename T> T GetField(voffset_t field, T defaultval) const {
1693 auto field_offset = GetOptionalFieldOffset(field);
1697 template<typename P> P GetPointer(voffset_t field) {
1698 auto field_offset = GetOptionalFieldOffset(field);
1704 template<typename P> P GetPointer(voffset_t field) const {
1705 return const_cast<Table *>(this)->GetPointer<P>(field);
1708 template<typename P> P GetStruct(voffset_t field) const {
1709 auto field_offset = GetOptionalFieldOffset(field);
1714 template<typename T> bool SetField(voffset_t field, T val) {
1715 auto field_offset = GetOptionalFieldOffset(field);
1721 bool SetPointer(voffset_t field, const uint8_t *val) {
1722 auto field_offset = GetOptionalFieldOffset(field);
1729 uint8_t *GetAddressOf(voffset_t field) {
1730 auto field_offset = GetOptionalFieldOffset(field);
1733 const uint8_t *GetAddressOf(voffset_t field) const {
1734 return const_cast<Table *>(this)->GetAddressOf(field);
1737 bool CheckField(voffset_t field) const {
1738 return GetOptionalFieldOffset(field) != 0;
1742 // Call this once per table, followed by VerifyField once per field.
1747 // Check the vtable size field, then check vtable fits in its entirety.
1754 // Verify a particular field.
1756 voffset_t field) const {
1759 auto field_offset = GetOptionalFieldOffset(field);
1760 // Check the actual field.
1766 voffset_t field) const {
1767 auto field_offset = GetOptionalFieldOffset(field);
1826 /// back again. The resolver gets a pointer to a field inside an object API
1829 /// matches that type). The value of this field is initially null, so you
1843 // Helper function to test if a field is present, using any of the field
1850 template<typename T> bool IsFieldPresent(const T *table, voffset_t field) {
1852 return reinterpret_cast<const Table *>(table)->CheckField(field);