* 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
*/
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)
*
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
*
* 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
*
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]