You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWTAI-Platform/Include/nmNum/nmData/nmPebiResultSnapshotSeriali...

63 lines
2.4 KiB
C++

#ifndef NMPEBIRESULTSNAPSHOTSERIALIZER_H
#define NMPEBIRESULTSNAPSHOTSERIALIZER_H
#include "nmData_global.h"
#include "nmNumericalResultPersistence.h"
#include <QSharedPointer>
#include <QString>
#include <QStringList>
class nmPebiResultSnapshot;
/**
* @brief 负责当前快照三文件载荷及 Snapshot.json 的流式保存和加载。
*
* 序列化器是快照的受限友元,只在保存时读取内部 VTK 对象;加载仍通过
* nmPebiResultSnapshotBuilder 构造和封闭候选。
*/
class NM_DATA_EXPORT nmPebiResultSnapshotSerializer
{
public:
/** @brief 将完整快照写入窗口目录下的 Snapshot 子目录。 */
static bool save(
const QSharedPointer<const nmPebiResultSnapshot>& pSnapshot,
const QString& sWindowDirectory,
nmNumericalFileReference& oSnapshotJsonReference,
QString* pError = NULL);
/** @brief 校验 Snapshot.json 及其三条引用,不创建快照对象。 */
static bool validate(
const QString& sWindowDirectory,
const nmNumericalFileReference& oSnapshotJsonReference,
QString* pError = NULL);
/** @brief 返回 Snapshot.json 中三个规范化载荷路径,供窗口级全局查重。 */
static bool getPayloadRelativePaths(
const QString& sWindowDirectory,
const nmNumericalFileReference& oSnapshotJsonReference,
QStringList& listRelativePaths,
QString* pError = NULL);
/** @brief 完整读取并通过 Builder 返回尚未发布的可写候选。 */
static bool load(
const QString& sWindowDirectory,
const nmNumericalFileReference& oSnapshotJsonReference,
QSharedPointer<nmPebiResultSnapshot>& pCandidate,
QString* pError = NULL);
private:
/** @brief 从快照内部数组流式写出全部压力帧。 */
static bool writePressureFrames(const nmPebiResultSnapshot& oSnapshot,
const QString& sFilePath,
QString* pError);
/** @brief 从快照内部井目录流式写出六组冻结曲线。 */
static bool writeWellCurves(const nmPebiResultSnapshot& oSnapshot,
const QString& sFilePath,
QString* pError);
/** @brief 禁止实例化纯静态序列化器。 */
nmPebiResultSnapshotSerializer();
};
#endif // NMPEBIRESULTSNAPSHOTSERIALIZER_H