Ferreteria/v0.6/clade/Sys/Data/Engine/aux/Updater
Jump to navigation
Jump to search
| ||||||||||||||||||||
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 -- //
}