MCPcopy Create free account
hub / github.com/chrxh/alien / serializeGenomeToFile

Method serializeGenomeToFile

source/PersisterInterface/SerializerService.cpp:996–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

994}
995
996bool SerializerService::serializeGenomeToFile(std::filesystem::path const& filename, std::vector<uint8_t> const& genome)
997{
998 try {
999 log(Priority::Important, "save genome to " + filename.string());
1000 //wrap constructor cell around genome
1001 ClusteredDataDescription data;
1002 if (!wrapGenome(data, genome)) {
1003 return false;
1004 }
1005
1006 zstr::ofstream stream(filename.string(), std::ios::binary);
1007 if (!stream) {
1008 return false;
1009 }
1010 serializeDataDescription(data, stream);
1011
1012 return true;
1013 } catch (...) {
1014 return false;
1015 }
1016}
1017
1018bool SerializerService::deserializeGenomeFromFile(std::vector<uint8_t>& genome, std::filesystem::path const& filename)
1019{

Callers 1

onSaveGenomeMethod · 0.80

Calls 1

logFunction · 0.85

Tested by

no test coverage detected