Methods isStackFull() and isStackEmpty() needs to be overwritten, too.
authorRoland Haeder <roland@mxchange.org>
Mon, 19 May 2014 18:55:00 +0000 (20:55 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 19 May 2014 18:55:00 +0000 (20:55 +0200)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/main/stacker/file/class_BaseFileStack.php

index 58a41f4..879f19d 100644 (file)
@@ -518,6 +518,36 @@ class BaseFileStack extends BaseStacker {
                return NULL;
        }
 
+       /**
+        * Checks whether the given stack is full
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $isFull                 Whether the stack is full
+        */
+       protected final function isStackFull ($stackerName) {
+               // File-based stacks will only run full if the disk space is low.
+               // @TODO Please implement this, returning FALSE
+               $isFull = FALSE;
+
+               // Return result
+               return $isFull;
+       }
+
+       /**
+        * Checks whether the given stack is empty
+        *
+        * @param       $stackerName            Name of the stack
+        * @return      $isEmpty                        Whether the stack is empty
+        * @throws      NoStackerException      If given stack is missing
+        */
+       public final function isStackEmpty ($stackerName) {
+               // So, is the stack empty?
+               $isEmpty = (($this->getStackCount($stackerName)) == 0);
+
+               // Return result
+               return $isEmpty;
+       }
+
        /**
         * Initializes given stacker
         *
@@ -527,7 +557,7 @@ class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public function initStack ($stackerName, $forceReInit = FALSE) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -537,7 +567,7 @@ class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public function initStacks (array $stacks, $forceReInit = FALSE) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -548,7 +578,7 @@ class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public function isStackInitialized ($stackerName) {
-               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**