*
* @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) 2011 - 2012 Cruncher Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
/**
* By default no cruncher is active
*/
- private $isActive = false;
+ private $isActive = FALSE;
/**
* All buffer queue instances (a FIFO)
*/
private $bufferInstance = NULL;
+ /**
+ * Stacker name for incoming queue
+ */
+ const STACKER_NAME_IN_QUEUE = 'in_queue';
+
+ /**
+ * Stacker name for outcoming queue
+ */
+ const STACKER_NAME_OUT_QUEUE = 'out_queue';
+
/**
* Protected constructor
*
*/
protected function isInBufferQueueFilled () {
// Determine it
- $isFilled = ($this->bufferInstance->getStackCount('in_queue') > $this->getConfigInstance()->getConfigEntry('cruncher_in_buffer_min_threshold'));
+ $isFilled = ($this->bufferInstance->getStackCount(self::STACKER_NAME_IN_QUEUE) > $this->getConfigInstance()->getConfigEntry('cruncher_in_buffer_min_threshold'));
// And return the result
return $isFilled;
* @param $version Version number of this cruncher
* @return void
*/
- public final function enableIsActive ($isActive = true) {
+ public final function enableIsActive ($isActive = TRUE) {
$this->isActive = (bool) $isActive;
}
$this->bufferInstance = ObjectFactory::createObjectByConfiguredName('cruncher_buffer_stacker_class');
// Initialize common stackers, like in/out
- $this->bufferInstance->initStacker('in_queue');
- $this->bufferInstance->initStacker('out_queue');
+ $this->bufferInstance->initStacks(array(
+ self::STACKER_NAME_IN_QUEUE,
+ self::STACKER_NAME_OUT_QUEUE
+ ));
// Output debug message
- $this->debugOutput('CRUNCHER: All buffers are now initialized.');
+ self::createDebugInstance(__CLASS__)->debugOutput('CRUNCHER: All buffers are now initialized.');
}
/**