Continued:
[core.git] / framework / main / classes / stacker / class_
1 <?php
2 // Own namespace
3 namespace Org\Mxchange\CoreFramework\Stack\!!!;
4
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
7 use Org\Mxchange\CoreFramework\Stack\BaseStacker;
8 use Org\Mxchange\CoreFramework\Stack\Stackable;
9
10 /**
11  * A ??? Stacker class
12  *
13  * @author              Roland Haeder <webmaster@ship-simu.org>
14  * @version             0.0.0
15  * @copyright   Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
16  * @license             GNU GPL 3.0 or any newer version
17  * @link                http://www.ship-simu.org
18  *
19  * This program is free software: you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation, either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  */
32 class ???Stacker extends BaseStacker implements Stackable {
33         /**
34          * Protected constructor
35          *
36          * @return      void
37          */
38         private function __construct () {
39                 // Call parent constructor
40                 parent::__construct(__CLASS__);
41         }
42
43         /**
44          * Creates an instance of the class Stacker and prepares it for usage
45          *
46          * @param       $appInstance    A manageable application
47          * @return      $stackInstance  An instance of ???Stacker
48          */
49         public final static function create???Stacker (ManageableApplication $appInstance) {
50                 // Get a new instance
51                 $stackInstance = new ???Stacker();
52
53                 // Init generic stacker
54                 $stackInstance->initStack('generic');
55
56                 // Return the prepared instance
57                 return $stackInstance;
58         }
59
60         /**
61          * Pushs a value on a named stacker
62          *
63          * @param       $stackerName    Name of the stack
64          * @param       $value                  Value to push on it
65          * @return      void
66          * @throws      StackerFullException    If the stack is full
67          */
68         public function pushNamed ($stackerName, $value) {
69                 DebugMiddleware::getSelfInstance()->partialStub('stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . $value);
70         }
71
72         /**
73          * 'Pops' a value from a named stacker
74          *
75          * @param       $stackerName    Name of the stack
76          * @return      void
77          * @throws      NoStackerException      If the named stacker was not found
78          * @throws      EmptyStackerException   If the named stacker is empty
79          */
80         public function popNamed ($stackerName) {
81                 DebugMiddleware::getSelfInstance()->partialStub('stackerName=' . $stackerName);
82         }
83
84         /**
85          * Get value from named stacker
86          *
87          * @param       $stackerName    Name of the stack
88          * @return      $value                  Value of last added value
89          * @throws      NoStackerException      If the named stacker was not found
90          * @throws      EmptyStackerException   If the named stacker is empty
91          */
92         public function getNamed ($stackerName) {
93                 DebugMiddleware::getSelfInstance()->partialStub('stackerName=' . $stackerName);
94         }
95
96 }