CorTeX Core ABI 7
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
ctxGraphDocument Class Reference

Retains one authoritative graph and an optional complete semantic snapshot. More...

#include <ctxGraphPersistence.h>

Public Member Functions

 ctxGraphDocument ()
 ctxGraphDocument (const ctxGraphDocument &document)
 ~ctxGraphDocument ()
ctxGraphDocument & operator= (const ctxGraphDocument &document)
gzGUID getDefinitionID () const
ctxGraph getGraph () const
 Returns the same retained graph; editing the returned value uses graph COW.
gzBool hasParameters () const
gzBool captureParameters (ctxModel &source, gzString &error)
 Captures a quiescent compiled model bound to this exact retained graph.
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.
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.

Static Public Member Functions

static gzBool fromGraph (const gzGUID &definitionID, const ctxGraph &graph, ctxGraphDocument &result, gzString &error)
 A non-null, caller-assigned persistent definition identity is required.
static gzBool load (gzSerializeAdapter *adapter, const gzString &formatID, ctxGraphDocument &result, gzString &error)
 Publishes only a valid successful candidate; failed reads preserve result.
static gzBool load (const gzString &url, ctxGraphDocument &result, gzString &error)
 Loads through an owned SDK URL input using its registered filename suffix.
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)

Friends

class ctxGraph
class ctxGraphDocumentFormat

Detailed Description

Retains one authoritative graph and an optional complete semantic snapshot.

Registered adapter formats supply their own preflight and serialization. Core installs ctx.graph.json/1 and ctx.graph.xml/1 on first registry use. XML reads require unchanged SDK XML type registrations throughout the call. URL loading selects a registered suffix; owned URL saving is not delivered. Copies share immutable state; successful capture publishes a new state.

Definition at line 166 of file ctxGraphPersistence.h.

Constructor & Destructor Documentation

◆ ctxGraphDocument() [1/2]

ctxGraphDocument::ctxGraphDocument ( )

◆ ctxGraphDocument() [2/2]

ctxGraphDocument::ctxGraphDocument ( const ctxGraphDocument & document)

References CTX_EXPORT, and ctxGraphDocument().

◆ ~ctxGraphDocument()

ctxGraphDocument::~ctxGraphDocument ( )

References CTX_EXPORT.

Member Function Documentation

◆ captureParameters()

gzBool ctxGraphDocument::captureParameters ( ctxModel & source,
gzString & error )

Captures a quiescent compiled model bound to this exact retained graph.

Supports native rank-one FLOAT Input/Dense/Activation/Output with LINEAR/TANH and unshared implicit or matching-index explicit projections. The current qualification scope is Evaluation with EVALUATE_GENETIC. Failure leaves this document, the source bank and its update ID unchanged.

References CTX_EXPORT.

◆ fromGraph()

gzBool ctxGraphDocument::fromGraph ( const gzGUID & definitionID,
const ctxGraph & graph,
ctxGraphDocument & result,
gzString & error )
static

A non-null, caller-assigned persistent definition identity is required.

References CTX_EXPORT, ctxGraph, and ctxGraphDocument().

◆ getDefinitionID()

gzGUID ctxGraphDocument::getDefinitionID ( ) const

References CTX_EXPORT.

◆ getGraph()

ctxGraph ctxGraphDocument::getGraph ( ) const

Returns the same retained graph; editing the returned value uses graph COW.

References CTX_EXPORT, and ctxGraph.

◆ hasParameters()

gzBool ctxGraphDocument::hasParameters ( ) const

References CTX_EXPORT.

◆ load() [1/2]

gzBool ctxGraphDocument::load ( const gzString & url,
ctxGraphDocument & result,
gzString & error )
static

Loads through an owned SDK URL input using its registered filename suffix.

Pins the handler before opening the URL; releases input ownership before publication. Uses SDK URL resolution; no model build, initialization or restore is performed. Failure preserves result. SDK close durability is not an input-load guarantee.

References CTX_EXPORT, and ctxGraphDocument().

◆ load() [2/2]

gzBool ctxGraphDocument::load ( gzSerializeAdapter * adapter,
const gzString & formatID,
ctxGraphDocument & result,
gzString & error )
static

Publishes only a valid successful candidate; failed reads preserve result.

References CTX_EXPORT, and ctxGraphDocument().

◆ operator=()

ctxGraphDocument & ctxGraphDocument::operator= ( const ctxGraphDocument & document)

References CTX_EXPORT, and ctxGraphDocument().

◆ registerFormat()

gzBool ctxGraphDocument::registerFormat ( const gzString & formatID,
const gzString & suffix,
ctxGraphDocumentFormat * handler,
gzString * error = NULL )
static

IDs and lowercase ASCII suffixes are unique; built-in profile names are reserved.

References CTX_EXPORT, and ctxGraphDocumentFormat.

◆ restoreModel()

gzBool ctxGraphDocument::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.

Pins the immutable source document through external binding/compiler callbacks. Retained source/target contracts are checked before keys. Matching scalars retain exact finite bits; new scalars keep ordinary build/compile initialization. Success publishes the model and complete semantic report; failure preserves both outputs. Global RNG/allocator and external callback effects are not undone.

References CTX_EXPORT.

◆ save()

gzBool ctxGraphDocument::save ( gzSerializeAdapter * adapter,
const gzString & formatID,
gzBool embedParameters,
gzString & error ) const

Pins the handler before callbacks; does not flush, close or rewind the adapter.

References CTX_EXPORT.

◆ unregisterFormat()

gzBool ctxGraphDocument::unregisterFormat ( const gzString & formatID,
gzString * error = NULL )
static

References CTX_EXPORT.

◆ ctxGraph

friend class ctxGraph
friend

Definition at line 224 of file ctxGraphPersistence.h.

References ctxGraph.

Referenced by ctxGraph, ctxGraphDocumentFormat, fromGraph(), and getGraph().

◆ ctxGraphDocumentFormat

friend class ctxGraphDocumentFormat
friend

Definition at line 225 of file ctxGraphPersistence.h.

References ctxGraph, ctxGraphDocument(), and ctxGraphDocumentFormat.

Referenced by ctxGraphDocumentFormat, and registerFormat().


The documentation for this class was generated from the following file: