]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/file_stack/class_BaseFileStack.php
Fixed calling ObjectFactory::createObjectByConfiguredName() as 2nd parameter must...
[core.git] / inc / classes / main / file_stack / class_BaseFileStack.php
index 7c4c91e5bd497ad735cf204f9a591318d4e4507f..d53d1e3b1bb84b3e61e8c00a1e2f5d28f6033968 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -32,6 +32,26 @@ class BaseFileStack extends BaseFrameworkSystem {
                // Call parent constructor
                parent::__construct($className);
        }
+
+       /**
+        * Initializes this stack.
+        *
+        * @param       $fileName       File name of this stack
+        * @return      void
+        */
+       protected function initStack ($fileName) {
+               // Get a file i/o pointer instance
+               $pointerInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_output_class', array($fileName));
+
+               // Get iterator instance
+               $iteratorInstance = ObjectFactory::createObjectByConfiguredName('file_io_iterator_class', array($pointerInstance));
+
+               // Is the instance implementing the right interface?
+               assert($iteratorInstance instanceof SeekableFileIterator);
+
+               // Set iterator here
+               $this->setIteratorInstance($iteratorInstance);
+       }
 }
 
 // [EOF]