OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
BinConfigWriter.h
Go to the documentation of this file.
1//
2// Class BinConfigWriter
3// Writes binning configuration snapshots to a JSON file.
4//
5// Copyright (c) 2026, Paul Scherrer Institut
6// All rights reserved
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18
19#ifndef OPAL_BIN_CONFIG_WRITER_H
20#define OPAL_BIN_CONFIG_WRITER_H
21
22#include <cstddef>
23#include <fstream>
24#include <string>
25#include <vector>
26
35public:
36 explicit BinConfigWriter(const std::string& fileName);
37
39
40 void writeEntry(
41 long long step, double time, bool preMerge, const std::vector<std::size_t>& binCounts,
42 const std::vector<double>& binWidths, double xMin);
43
44private:
45 std::ofstream os_;
46 bool first_;
47};
48
49#endif // OPAL_BIN_CONFIG_WRITER_H
Helper to write binning configuration snapshots as a JSON array.
void writeEntry(long long step, double time, bool preMerge, const std::vector< std::size_t > &binCounts, const std::vector< double > &binWidths, double xMin)
std::ofstream os_