Ferreteria/v0.6/clade/Sys/Data/Engine/aux/Updater

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Engine‎ | aux
Jump to navigation Jump to search
clade: Sys\Data\Engine\aux\Updater
Clade Family
Updater Updater (none)
Clade Aliases
Alias Clade
Base* [c,i] IO\Aspect\Connx\Stream\aux\Updater
EngineIface Sys\Data\Engine
SelfIface Sys\Data\Engine\aux\Updater
Stream* [c,i] IO\Aspect\Connx\Stream
Subpages

Code

as of 2026-04-09, just before reworking it to be Canal-based instead of Stream-based (and updating the On*() calls):

interface iUpdater extends BaseIface {
    // SETUP
    static function FromEngine(EngineIface $oEng, StreamIface $oStm) : SelfIface;
}
class cUpdater extends BaseClass implements iUpdater {
    // ++ SETUP ++ //

    public static function FromEngine(EngineIface $oEng, StreamIface $oStm) : SelfIface {
        $oThis = new static;
        $oThis->WithEngine($oEng);
        $oThis->WithStream($oStm);
        return $oThis;
    }

    // ++ SETUP: dynamic ++ //

    private $oEngine;
    protected function WithEngine(EngineIface $o) { $this->oEngine = $o; }

    // -- SETUP -- //
    // ++ EVENTS ++ //

    // OVERRIDE
    public function OnIterate() {
        parent::OnIterate();
        // now do something with the Engine...
        $this->OEngine()->CheckStream($this->OStream());
    }

    // -- EVENTS -- //
    // ++ OBJECTS ++ //

    protected function OEngine() : EngineIface { return $this->oEngine; }

    // -- OBJECTS -- //
}