MCPcopy Create free account
hub / github.com/catboost/catboost / SaveArrayData

Function SaveArrayData

catboost/libs/helpers/serialization.h:50–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 // Note: does not store data size!
49 template <class T>
50 inline void SaveArrayData(TConstArrayRef<T> data, IBinSaver* binSaver) {
51 Y_ASSERT(!binSaver->IsReading());
52 if (IBinSaver::HasNonTrivialSerializer<T>(0u)) {
53 for (const auto& element : data) {
54 binSaver->Add(0, const_cast<T*>(&element));
55 }
56 } else {
57 binSaver->AddRawData(
58 0,
59 const_cast<void*>((const void*)data.data()),
60 SafeIntegerCast<i64>(sizeof(T) * data.size())
61 );
62 }
63 }
64
65 // Note: does not load data size!
66 template <class T>

Callers 2

SaveAsCompressedArrayFunction · 0.85
SaveMethod · 0.85

Calls 5

IsReadingMethod · 0.80
AddRawDataMethod · 0.80
AddMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected