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