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

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

#include <StateDecoder.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.
 
StateDecoderoperator= (const StateDecoder &)=delete
 
StateDecoderoperator= (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.
 
 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 Fabric state from a previously encoded EXR + JSON schema pair.

v1 scope: reads {base_path}.exr (schema v2) and patches Emitters, Sensors, and Agents by id. Dispatches per Kind; entities present in the schema but absent from the Fabric are logged and counted in missing_count(). Optional fields (color, size) are only patched when the schema records a non-null value. Callable name mismatches between schema and live entity are warned but do not abort the patch.

Definition at line 18 of file StateDecoder.hpp.


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