]> git.mxchange.org Git - hub.git/commitdiff
Made two (generic/'base') classes abstract because calls are done from the generic...
authorRoland Häder <roland@mxchange.org>
Mon, 14 Mar 2011 21:30:13 +0000 (21:30 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 14 Mar 2011 21:30:13 +0000 (21:30 +0000)
application/hub/main/cruncher/class_BaseHubCruncher.php
application/hub/main/helper/work_units/class_
application/hub/main/helper/work_units/class_BaseWorkUnitHelper.php
application/hub/main/helper/work_units/cruncher/class_CruncherTestUnitHelper.php

index 5e09d9e385d4ceccd9d1c674651a778b4f827288..cbaa0e3ad861cf9da09991d6132a1a24ce960d51 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-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)
         *
index 1c6100e58c2fe657814a902a4c132a94918d4075..90273eae622daa6fdcf78b46d6d51ed46ebdf512 100644 (file)
@@ -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
         *
index 22811cb9d3aa5ac19947c7860c80fabaef646f43..e41e4e49ad9e6c2444093dbd2d979a8fb0ef6c01 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-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]
index 1096f082dda2f5aea0c44f0d051f4e8ad74eaa1b..f97f8d3a090bf7a5daff489ca9457b2f9dd6ae80 100644 (file)
@@ -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
         *