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