]> git.mxchange.org Git - hub.git/commitdiff
Block and WU producers are two different producer classes.
authorRoland Haeder <roland@mxchange.org>
Mon, 31 Mar 2014 22:00:50 +0000 (00:00 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 31 Mar 2014 22:00:50 +0000 (00:00 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/interfaces/producer/block/.htaccess [new file with mode: 0644]
application/hub/interfaces/producer/block/class_BlockProducer.php [new file with mode: 0644]
application/hub/main/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php
application/hub/main/states/miner/init/class_MinerInitState.php

diff --git a/application/hub/interfaces/producer/block/.htaccess b/application/hub/interfaces/producer/block/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/producer/block/class_BlockProducer.php b/application/hub/interfaces/producer/block/class_BlockProducer.php
new file mode 100644 (file)
index 0000000..2c61358
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * An interface for the producer/consumer implementation, especially for block
+ * producers.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface BlockProducer extends Producer, Executor {
+       /**
+        * Prepares the produces of some work/test units and pushes them onto the queue
+        *
+        * @param       $stateInstance  An instance of a Stateable instance
+        * @return      void
+        */
+       function prepareBlockProduction (Stateable $stateInstance);
+}
+
+// [EOF]
+?>
index 44ac83e6d0ba1813efb6a1545c65e0ad48174d43..d67cdd66e075adfd157be43283aa9ca2bf2e5aef 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 MinerTestGenesisBlockProducer extends BaseUnitProducer implements UnitProducer, Registerable {
+class MinerTestGenesisBlockProducer extends BaseBlockProducer implements BlockProducer, Registerable {
        /**
         * Protected constructor
         *
@@ -63,7 +63,7 @@ class MinerTestGenesisBlockProducer extends BaseUnitProducer implements UnitProd
         * @return      void
         * @todo        0% done
         */
-       public function prepareUnitProduction (Stateable $stateInstance) {
+       public function prepareBlockProduction (Stateable $stateInstance) {
                $this->partialStub('Please implement this method, stateInstance=' . $stateInstance->__toString());
        }
 }
index 02d35320961e2b4f2c99e1ad5e4f0d52d6f029a3..14caefed5dcdd67c5944a1e02cdbf4533bc8d577 100644 (file)
@@ -60,7 +60,7 @@ class MinerInitState extends BaseMinerState implements Stateable {
         */
        public function executeState (Executor $executorInstance) {
                // Now prepare the unit production to maybe become 'virgin' or 'active' if work/test units are there
-               $executorInstance->prepareUnitProduction($this);
+               $executorInstance->prepareBlockProduction($this);
        }
 
        /**