3 * A ??? file-based stack
5 * @author Roland Haeder <webmaster@ship-simu.org>
7 <<<<<<< HEAD:framework/main/classes/stacker/file/class_
8 * @copyright Copyright (c) 2017 Core Developer Team
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
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.
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.
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/>.
28 class ???FileStack extends BaseFileStack implements StackableFile, Registerable {
30 * Protected constructor
34 protected function __construct () {
35 // Call parent constructor
36 parent::__construct(__CLASS__);
40 * Creates an instance of this class
42 * @param $fileName Absolute Name of stack file
43 * @return $stackInstance An instance of a StackableFile class
45 public final static function create???FileStack ($fileName) {
47 $stackInstance = new ???FileStack();
50 $stackInstance->initStack($fileName);
52 // Return the prepared instance
53 return $stackInstance;
57 * Pushs a value on a named stacker
59 * @param $stackerName Name of the stack
60 * @param $value Value to push on it
62 * @throws StackerFullException If the stack is full
64 public function pushNamed ($stackerName, $value) {
65 $this->partialStub('stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . $value);
69 * 'Pops' a value from a named stacker
71 * @param $stackerName Name of the stack
73 * @throws NoStackerException If the named stacker was not found
74 * @throws EmptyStackerException If the named stacker is empty
76 public function popNamed ($stackerName) {
77 $this->partialStub('stackerName=' . $stackerName);
81 * Get value from named stacker
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
88 public function getNamed ($stackerName) {
89 $this->partialStub('stackerName=' . $stackerName);
93 * Seeks to given position
95 * @param $seekPosition Seek position in file
98 public function seek ($seekPosition) {
99 $this->partialStub('seekPosition=' . $seekPosition);
105 * @return $size Size (in bytes) of file
107 public function size () {
108 $this->partialStub();