| 940 | } |
| 941 | |
| 942 | bool SerializerService::serializeSimulationToStrings(SerializedSimulation& output, DeserializedSimulation const& input) |
| 943 | { |
| 944 | try { |
| 945 | { |
| 946 | std::stringstream stdStream; |
| 947 | zstr::ostream stream(stdStream, std::ios::binary); |
| 948 | if (!stream) { |
| 949 | return false; |
| 950 | } |
| 951 | serializeDataDescription(input.mainData, stream); |
| 952 | stream.flush(); |
| 953 | output.mainData = stdStream.str(); |
| 954 | } |
| 955 | { |
| 956 | std::stringstream stream; |
| 957 | serializeAuxiliaryData(input.auxiliaryData, stream); |
| 958 | output.auxiliaryData = stream.str(); |
| 959 | } |
| 960 | { |
| 961 | std::stringstream stream; |
| 962 | serializeStatistics(input.statistics, stream); |
| 963 | output.statistics = stream.str(); |
| 964 | } |
| 965 | return true; |
| 966 | } catch (...) { |
| 967 | return false; |
| 968 | } |
| 969 | } |
| 970 | |
| 971 | bool SerializerService::deserializeSimulationFromStrings(DeserializedSimulation& output, SerializedSimulation const& input) |
| 972 | { |