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