27#ifndef __CTX_GRAPH_PERSISTENCE_H__
28#define __CTX_GRAPH_PERSISTENCE_H__
32class ctxGraphDocumentState;
34class ctxParameterRestoreReportState;
80 ctxParameterRestoreReportState* getState()
const;
81 gzRefPointer<gzReference> m_state;
95 gzString& error)
const = 0;
97 gzBool embedParameters, gzString& error) = 0;
117 gzBool embedParameters, gzString& error);
125 gzSerializeAdapter* adapter, gzBool embedParameters, gzString& error);
137 gzBool embedParameters, gzString& error);
145 gzSerializeAdapter* adapter, gzBool embedParameters, gzString& error);
206 gzBool embedParameters, gzString& error)
const;
208 CTX_EXPORT static gzBool
load(gzSerializeAdapter* adapter,
const gzString& formatID,
228 gzBool embedParameters, gzDynamicType& records, gzString& error);
230 gzSerializeAdapter* adapter, gzBool embedParameters, gzString& error);
231 static gzBool validateJsonDocumentRecords(
const gzDynamicType& records, gzString& error);
232 static gzBool decodeJsonDocumentRecords(
const gzDynamicType& records,
234 static gzBool decodeGraphXmlDefinition(gzXmlElement* root,
235 const gzArray<ctxGraphOperation>& parsedOperations, gzUInt32 operationElementCount,
237 ctxGraphDocumentState* getState()
const;
238 gzBool validateFormatDocument(gzString& error)
const;
241 gzRefPointer<gzReference> m_state;
Immutable request to realize a graph revision or adapt a direct ctxCortex.
Retains one authoritative graph and an optional complete semantic snapshot.
ctxGraph getGraph() const
Returns the same retained graph; editing the returned value uses graph COW.
static gzBool registerFormat(const gzString &formatID, const gzString &suffix, ctxGraphDocumentFormat *handler, gzString *error=NULL)
IDs and lowercase ASCII suffixes are unique; built-in profile names are reserved.
static gzBool unregisterFormat(const gzString &formatID, gzString *error=NULL)
gzBool restoreModel(const ctxBuildRequest &build, const ctxCompileOptions &compile, ctxModelPtr &result, ctxParameterRestoreReport &report, gzString &error) const
Explicitly builds/compiles an owned Evaluation candidate for this exact graph.
ctxGraphDocument(const ctxGraphDocument &document)
static gzBool fromGraph(const gzGUID &definitionID, const ctxGraph &graph, ctxGraphDocument &result, gzString &error)
A non-null, caller-assigned persistent definition identity is required.
gzBool captureParameters(ctxModel &source, gzString &error)
Captures a quiescent compiled model bound to this exact retained graph.
gzGUID getDefinitionID() const
static gzBool load(const gzString &url, ctxGraphDocument &result, gzString &error)
Loads through an owned SDK URL input using its registered filename suffix.
static gzBool load(gzSerializeAdapter *adapter, const gzString &formatID, ctxGraphDocument &result, gzString &error)
Publishes only a valid successful candidate; failed reads preserve result.
gzBool save(gzSerializeAdapter *adapter, const gzString &formatID, gzBool embedParameters, gzString &error) const
Pins the handler before callbacks; does not flush, close or rewind the adapter.
friend class ctxGraphDocumentFormat
ctxGraphDocument & operator=(const ctxGraphDocument &document)
gzBool hasParameters() const
Immutable complete result; copies retain the same report and entries.
ctxParameterRestoreReport()
const ctxParameterRestoreEntry * getEntry(gzUInt32 index) const
Returned entries live as long as a copy of this report remains retained.
gzUInt32 getDroppedCount() const
ctxParameterRestoreReport(const ctxParameterRestoreReport &report)
ctxParameterRestoreReport & operator=(const ctxParameterRestoreReport &report)
~ctxParameterRestoreReport()
gzBool hasSnapshot() const
gzUInt32 getInitializedCount() const
gzUInt32 getEntryCount() const
gzUInt32 getRestoredCount() const
friend class ctxGraphDocument
ctxParameterRestoreAction
@ CTX_PARAMETER_INITIALIZED
gzBool(*) ctxGraphDocumentJsonValidator(const gzDynamicType &records, gzString &error)
Validates every original named record and typed value without rebuilding it.
One semantic scalar action; path is diagnostic, never matching identity.
gzUInt32 ownerOccurrenceID
ctxParameterRestoreAction action
gzUInt32 destinationIndex
gzUInt32 sourceOccurrenceID
ctxParameterRestoreEntry()