MCPcopy Create free account
hub / github.com/apache/brpc / add_primitive

Function add_primitive

src/mcpack2pb/serializer.cpp:244–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242
243template <typename T>
244inline void add_primitive(
245 OutputStream* stream, Serializer::GroupInfo & group_info, T value) {
246 if (!stream->good()) {
247 return;
248 }
249 if (!array_add_item(stream, group_info, GetFieldType<T>::value, 1)) {
250 return stream->set_bad();
251 }
252 if (group_info.isomorphic) {
253 stream->append_packed_pod(value);
254 } else {
255 FixedHeadAndValue<T> head_and_value;
256 head_and_value.head.set_type(GetFieldType<T>::value);
257 head_and_value.head.set_name_size(0);
258 head_and_value.value = value;
259 stream->append_packed_pod(head_and_value);
260 }
261}
262
263template <typename T>
264inline void add_primitive(OutputStream* stream,

Callers 11

add_int8Method · 0.85
add_int16Method · 0.85
add_int32Method · 0.85
add_int64Method · 0.85
add_uint8Method · 0.85
add_uint16Method · 0.85
add_uint32Method · 0.85
add_uint64Method · 0.85
add_boolMethod · 0.85
add_floatMethod · 0.85
add_doubleMethod · 0.85

Calls 13

array_add_itemFunction · 0.85
object_add_itemFunction · 0.85
fast_memcpyFunction · 0.85
append_packed_podMethod · 0.80
skip_continuousMethod · 0.80
goodMethod · 0.45
set_badMethod · 0.45
set_typeMethod · 0.45
set_name_sizeMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected