]> git.mxchange.org Git - city.git/blob - application/city/classes/city_daemon/class_
Continued:
[city.git] / application / city / classes / city_daemon / class_
1 <?php
2 // Own namespace
3 namespace Org\Mxchange\City\Daemon\Simulation;
4
5 // Import application-specific stuff
6 use Org\Mxchange\City\Helper\CityHelper;
7
8 // Import framework stuff
9 use Org\Mxchange\CoreFramework\Handler\Task\HandleableTask;
10 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
11 use Org\Mxchange\CoreFramework\Registry\Registerable;
12 use Org\Mxchange\CoreFramework\Request\Requestable;
13
14 /**
15  * A hub-node class for the '???' mode
16  *
17  * @author              Roland Haeder <webmaster@ship-simu.org>
18  * @version             0.0.0
19  * @copyright   Copyright (c) 2015 - 2023 City Developer Team
20  * @license             GNU GPL 3.0 or any newer version
21  * @link                http://www.ship-simu.org
22  *
23  * This program is free software: you can redistribute it and/or modify
24  * it under the terms of the GNU General Public License as published by
25  * the Free Software Foundation, either version 3 of the License, or
26  * (at your option) any later version.
27  *
28  * This program is distributed in the hope that it will be useful,
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31  * GNU General Public License for more details.
32  *
33  * You should have received a copy of the GNU General Public License
34  * along with this program. If not, see <http://www.gnu.org/licenses/>.
35  */
36 class Simulation???CityDaemon extends BaseCity implements CityHelper, Registerable {
37         /**
38          * Protected constructor
39          *
40          * @return      void
41          */
42         protected function __construct () {
43                 // Call parent constructor
44                 parent::__construct(__CLASS__);
45         }
46
47         /**
48          * Creates an instance of this hub-node class
49          *
50          * @param       $requestInstance        An instance of a Requestable class
51          * @return      $nodeInstance           An instance of this hub-node class
52          */
53         public final static function createSimulation???CityDaemon (Requestable $requestInstance) {
54                 // Get a new instance
55                 $nodeInstance = new Simulation???CityDaemon();
56
57                 // Set the request instance
58                 $nodeInstance->setRequestInstance($requestInstance);
59
60                 // Return the instance
61                 return $nodeInstance;
62         }
63
64         /**
65          * Method to "bootstrap" the node. This step does also apply provided
66          * command-line arguments stored in the request instance. The regular node
67          * should communicate with the bootstrap-nodes at this point.
68          *
69          * @return      void
70          * @todo        Implement this method
71          */
72         public function doBootstrapping () {
73                 // Call generic (parent) bootstrapping method first
74                 parent::doGenericBootstrapping();
75                 DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
76         }
77
78         /**
79          * Initializes hub-specific queues
80          *
81          * @return      void
82          * @todo        Implement this method
83          */
84         public function initQueues () {
85                 DebugMiddleware::getSelfInstance()->partialStub('Please implement this method.');
86         }
87
88         /**
89          * Add some node-specific filters
90          *
91          * @return      void
92          */
93         public function addExtraCityFilters () {
94                 // Add some filters here
95         }
96
97         /**
98          * Adds extra tasks to the given handler for this node
99          *
100          * @param       $handlerInstance        An instance of a HandleableTask class
101          * @return      void
102          * @todo        0% done
103          */
104         public function addExtraTasks (HandleableTask $handlerInstance) {
105                 DebugMiddleware::getSelfInstance()->partialStub('Please add some tasks or empty this method.');
106         }
107 }