From 742af702fef26fa6eed5e7deff237d95a84abf10 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 14 Mar 2011 21:30:13 +0000 Subject: [PATCH] Made two (generic/'base') classes abstract because calls are done from the generic/'base' class to a concrete class --- .../main/cruncher/class_BaseHubCruncher.php | 23 ++++++++++++++++++- application/hub/main/helper/work_units/class_ | 10 ++++++++ .../work_units/class_BaseWorkUnitHelper.php | 12 +++++++++- .../cruncher/class_CruncherTestUnitHelper.php | 10 ++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/application/hub/main/cruncher/class_BaseHubCruncher.php b/application/hub/main/cruncher/class_BaseHubCruncher.php index 5e09d9e38..cbaa0e3ad 100644 --- a/application/hub/main/cruncher/class_BaseHubCruncher.php +++ b/application/hub/main/cruncher/class_BaseHubCruncher.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseHubCruncher extends BaseHubSystem implements Updateable { +abstract class BaseHubCruncher extends BaseHubSystem implements Updateable { /** * Version information */ @@ -81,6 +81,27 @@ class BaseHubCruncher extends BaseHubSystem implements Updateable { return $isFilled; } + /** + * This method fills the in-buffer with (a) test unit(s) which are mainly + * used for development of the crunching part. They must be enabled in + * configuration, or else your cruncher runs out of WUs and waits for more + * to show up. + * + * In this method we already know that the in-buffer is going depleted so + * we don't need to double-check it here. + * + * @return void + */ + abstract protected function fillInBufferQueueWithTestUnits (); + + /** + * This method fills the in-buffer with (real) WUs which will be crunched + * and the result be sent back to the key producer instance. + * + * @return void + */ + abstract protected function fillInBufferQueueWithWorkUnits (); + /** * Enables/disables the cruncher (just sets a flag) * diff --git a/application/hub/main/helper/work_units/class_ b/application/hub/main/helper/work_units/class_ index 1c6100e58..90273eae6 100644 --- a/application/hub/main/helper/work_units/class_ +++ b/application/hub/main/helper/work_units/class_ @@ -45,6 +45,16 @@ class ???WorkUnitHelper extends BaseWorkUnitHelper implements UnitHelper { return $unitInstance; } + /** + * Initializes this WU helper + * + * @return void + * @todo 0% done + */ + protected function initializeUnitHelper () { + $this->partialStub('Please implement this method.'); + } + /** * Generates a work/test/foo unit instance * diff --git a/application/hub/main/helper/work_units/class_BaseWorkUnitHelper.php b/application/hub/main/helper/work_units/class_BaseWorkUnitHelper.php index 22811cb9d..e41e4e49a 100644 --- a/application/hub/main/helper/work_units/class_BaseWorkUnitHelper.php +++ b/application/hub/main/helper/work_units/class_BaseWorkUnitHelper.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseWorkUnitHelper extends BaseFrameworkSystem { +abstract class BaseWorkUnitHelper extends BaseFrameworkSystem { /** * Protected constructor * @@ -31,7 +31,17 @@ class BaseWorkUnitHelper extends BaseFrameworkSystem { protected function __construct ($className) { // Call parent constructor parent::__construct($className); + + // All WU helpers needs to be initialized + $this->initializeUnitHelper(); } + + /** + * Initializes this WU helper + * + * @return void + */ + abstract protected function initializeUnitHelper (); } // [EOF] diff --git a/application/hub/main/helper/work_units/cruncher/class_CruncherTestUnitHelper.php b/application/hub/main/helper/work_units/cruncher/class_CruncherTestUnitHelper.php index 1096f082d..f97f8d3a0 100644 --- a/application/hub/main/helper/work_units/cruncher/class_CruncherTestUnitHelper.php +++ b/application/hub/main/helper/work_units/cruncher/class_CruncherTestUnitHelper.php @@ -45,6 +45,16 @@ class CruncherTestUnitHelper extends BaseWorkUnitHelper implements UnitHelper { return $unitInstance; } + /** + * Initializes this WU helper + * + * @return void + * @todo 0% done + */ + protected function initializeUnitHelper () { + $this->partialStub('Please implement this method.'); + } + /** * Generates a work/test/foo unit instance * -- 2.39.5