MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Nexus::StateDecoder Class Reference

Patches or rebuilds Fabric state from a previously encoded EXR + JSON schema pair. More...

#include <Decoder.hpp>

+ Collaboration diagram for MayaFlux::Nexus::StateDecoder:

Classes

struct  ReconstructionResult
 Result of a reconstruct() call. More...
 

Public Member Functions

bool decode (Fabric &fabric, const std::string &base_path)
 Decode and apply to fabric.
 
const std::string & last_error () const
 Last error message, empty if no error.
 
size_t missing_count () const
 Number of ids present in the schema but missing from the fabric.
 
StateDecoder & operator= (const StateDecoder &)=delete
 
StateDecoder & operator= (StateDecoder &&)=default
 
size_t patched_count () const
 Number of Emitters actually patched on the last decode call.
 
ReconstructionResult reconstruct (Fabric &fabric, const std::string &base_path)
 Patch existing entities and construct missing ones from schema.
 
ReconstructionResult reconstruct (Tapestry &tapestry, const std::string &base_dir)
 Reconstruct all Fabrics in tapestry from base_dir.
 
 StateDecoder ()=default
 
 StateDecoder (const StateDecoder &)=delete
 
 StateDecoder (StateDecoder &&)=default
 
 ~StateDecoder ()=default
 

Private Attributes

std::string m_last_error
 
size_t m_missing_count { 0 }
 
size_t m_patched_count { 0 }
 

Detailed Description

Patches or rebuilds Fabric state from a previously encoded EXR + JSON schema pair.

Does what the classes allow and reports the rest. Emitters, Sensors, Agents (including Locus and Presence) are patched by id or constructed; their Expanses are restored. Optional fields (position, orientation, color, size) are applied only when the schema records them, except that an absent position clears the entity's position. Callable name mismatches between schema and live entity are warned but do not abort the patch.

Live objects are never invented. Sinks, typed influences and perceptions, attachments, a Locus's view targets and every wiring source that needs a window, a network source or a callable are reported as warnings, and a wiring that cannot be restored falls back to commit_driven. A Hull needs a buffer and is skipped; a Mantle comes back as its plain box. Files from schema versions k_schema_min_version up to k_schema_version are read, with fields added since taking their defaults.

Definition at line 27 of file Decoder.hpp.


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