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