MCPcopy Create free account
hub / github.com/dmlc/dmlc-core / Write

Method Write

include/dmlc/serializer.h:84–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82template<typename T>
83struct ArithmeticHandler {
84 inline static void Write(Stream *strm, const T &data) {
85 if (DMLC_IO_NO_ENDIAN_SWAP) {
86 strm->Write(&data, sizeof(T));
87 } else {
88 T copy = data;
89 ByteSwap(&copy, sizeof(T), 1);
90 strm->Write(&copy, sizeof(T));
91 }
92 }
93 inline static bool Read(Stream *strm, T *dptr) {
94 bool ret = strm->Read((void*)dptr, sizeof(T)) == sizeof(T); // NOLINT(*)
95 if (!DMLC_IO_NO_ENDIAN_SWAP) {

Callers

nothing calls this directly

Calls 2

ByteSwapFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected