MCPcopy Create free account
hub / github.com/apache/impala / EncodePOD

Function EncodePOD

be/src/gutil/strings/serialize.h:178–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176// in place of:
177// string s = EncodeUint32(static_cast<uint32>(i));
178template <typename T> inline string EncodePOD(const T& value) {
179 ENFORCE_POD(T);
180 string s;
181 STLStringResizeUninitialized(&s, sizeof(T));
182 memcpy(string_as_array(&s), &value, sizeof(T));
183 return s;
184}
185
186// Retrieves the bytes of a plain old data type value from a StringPiece.
187// Verifies the given data type is a POD and copies the bytes of the

Callers 4

EncodeDoubleFunction · 0.85
EncodeFloatFunction · 0.85
EncodeUint32Function · 0.85
EncodeUint64Function · 0.85

Calls 2

string_as_arrayFunction · 0.85

Tested by

no test coverage detected