Lines Matching refs:field

64   for (const auto& field : fields_) {  in AssignSizeFields()  local
65 DEBUG() << "field name: " << field->GetName(); in AssignSizeFields()
67 …if (field->GetFieldType() != SizeField::kFieldType && field->GetFieldType() != CountField::kFieldT… in AssignSizeFields()
71 const SizeField* size_field = static_cast<SizeField*>(field); in AssignSizeFields()
75 ERROR(field) << "Could not find corresponding field for size/count field."; in AssignSizeFields()
107 ERROR(field, size_field) << "Can not use size/count in reference to a fixed size field.\n"; in AssignSizeFields()
119 for (const auto& field : fields_) { in GetSize() local
121 …(field->GetFieldType() == PayloadField::kFieldType || field->GetFieldType() == BodyField::kFieldTy… in GetSize()
126 if (field->GetFieldType() == CustomField::kFieldType && field->GetSize().has_dynamic()) { in GetSize()
130 custom_field_size << field->GetSize().dynamic_string() << "(begin()"; in GetSize()
135 auto offset = GetOffsetForField(field->GetName(), false); in GetSize()
137 ERROR(field) << "Custom Field offset can not be determined from begin()."; in GetSize()
141 ERROR(field) << "Custom fields must be byte aligned."; in GetSize()
151 size += field->GetSize(); in GetSize()
178 const auto& field = *it; in GetOffsetForField() local
180 if (field->GetSize().empty()) { in GetOffsetForField()
183 if (field->GetFieldType() != PaddingField::kFieldType || !from_end) { in GetOffsetForField()
184 size += field->GetSize(); in GetOffsetForField()
236 for (const auto& field : parent_params) { in GetParamList() local
237 if (parent_constraints_.find(field->GetName()) == parent_constraints_.end()) { in GetParamList()
238 params.AppendField(field); in GetParamList()
271 for (const auto& field : header_fields) { in GenSize() local
272 s << " + " << field->GetBuilderSize(); in GenSize()
280 for (const auto& field : footer_fields) { in GenSize() local
281 s << " + " << field->GetBuilderSize(); in GenSize()
302 for (const auto& field : header_fields) { in GenSize() local
303 if (field->GetFieldType() == PaddingField::kFieldType) { in GenSize()
305 ERROR() << "Only one padding field is allowed. Second field: " << field->GetName(); in GenSize()
307 padded_size = field->GetSize(); in GenSize()
322 for (const auto& field : header_fields) { in GenSize() local
323 if (field->GetFieldType() == SizeField::kFieldType) { in GenSize()
324 const auto& field_name = ((SizeField*)field)->GetSizedFieldName(); in GenSize()
354 for (const auto& field : header_fields) { in GenSerialize() local
355 if (field->GetFieldType() == SizeField::kFieldType) { in GenSerialize()
356 const auto& field_name = ((SizeField*)field)->GetSizedFieldName(); in GenSerialize()
359 ERROR(field) << __func__ << ": Can't find sized field named " << field_name; in GenSerialize()
368 … s << "ASSERT(payload_bytes < (static_cast<size_t>(1) << " << field->GetSize().bits() << "));"; in GenSerialize()
369 …s << "insert(static_cast<" << field->GetDataType() << ">(payload_bytes), i," << field->GetSize().b… in GenSerialize()
371 s << field->GetName() << "_extracted_ = 0;"; in GenSerialize()
374 …s << "ASSERT((size() - local_size) < (static_cast<size_t>(1) << " << field->GetSize().bits() << ")… in GenSerialize()
375 …s << "insert(static_cast<" << field->GetDataType() << ">(size() - local_size), i," << field->GetSi… in GenSerialize()
379 ERROR(field) << __func__ << ": Unhandled sized field type for " << field_name; in GenSerialize()
397 s << "ASSERT(" << vector_name + "bytes < (1 << " << field->GetSize().bits() << "));"; in GenSerialize()
399 s << field->GetSize().bits() << ");"; in GenSerialize()
401 } else if (field->GetFieldType() == ChecksumStartField::kFieldType) { in GenSerialize()
402 const auto& field_name = ((ChecksumStartField*)field)->GetStartedFieldName(); in GenSerialize()
405 …ERROR(field) << __func__ << ": Can't find checksum field named " << field_name << "(" << field->Ge… in GenSerialize()
413 } else if (field->GetFieldType() == PaddingField::kFieldType) { in GenSerialize()
414 s << "ASSERT(unpadded_size() <= " << field->GetSize().bytes() << ");"; in GenSerialize()
416 s << field->GetSize().bytes() << " - unpadded_size();"; in GenSerialize()
418 } else if (field->GetFieldType() == CountField::kFieldType) { in GenSerialize()
419 const auto& vector_name = ((SizeField*)field)->GetSizedFieldName() + "_"; in GenSerialize()
420 s << "insert(" << vector_name << ".size(), i, " << field->GetSize().bits() << ");"; in GenSerialize()
422 field->GenInserter(s); in GenSerialize()
433 for (const auto& field : footer_fields) { in GenSerialize() local
434 field->GenInserter(s); in GenSerialize()
467 const auto& field = parent_params[i]; in GenInstanceOf() local
468 const auto& constraint = parent_constraints_.find(field->GetName()); in GenInstanceOf()
470 s << "if (parent." << field->GetName() << "_ != "; in GenInstanceOf()
471 if (field->GetFieldType() == ScalarField::kFieldType) { in GenInstanceOf()
474 } else if (field->GetFieldType() == EnumField::kFieldType) { in GenInstanceOf()
478 ERROR(field) << "Constraints on non enum/scalar fields should be impossible."; in GenInstanceOf()