*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
$this->poolEntriesInstance = ObjectFactory::createObjectByConfiguredName('pool_entries_list_class');
}
+ /**
+ * Getter for pool entries instance
+ *
+ * @return $poolEntriesInstance An instance for pool entries (list)
+ */
+ public final function getPoolEntriesInstance () {
+ return $this->poolEntriesInstance;
+ }
+
/**
* Adds an instance to a pool segment
*
*/
protected final function addInstance ($group, $poolName, Visitable $instance) {
// Is the pool group there?
- if (!$this->poolEntriesInstance->isGroupSet($group)) {
+ if (!$this->getPoolEntriesInstance()->isGroupSet($group)) {
// Create the missing pool group
- $this->poolEntriesInstance->addGroup($group);
+ $this->getPoolEntriesInstance()->addGroup($group);
} // END - if
// Add it to given pool group
- $this->poolEntriesInstance->addInstance($group, $poolName, $instance);
+ $this->getPoolEntriesInstance()->addInstance($group, $poolName, $instance);
}
/**
* @return void
*/
protected final function addPoolEntry ($poolEntry) {
- $this->poolEntriesInstance->addEntry('generic', $poolEntry);
+ $this->getPoolEntriesInstance()->addEntry('generic', $poolEntry);
}
/**
- * Accepts the visitor to rpocess the visit "request"
+ * Accepts the visitor to process the visit "request"
*
* @param $visitorInstance An instance of a Visitor class
* @return void
*/
public function accept (Visitor $visitorInstance) {
// Debug message
- $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - START');
+ //* DEBUG: */ $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - START');
// Visit this pool
$visitorInstance->visitPool($this);
// Get a new iterator instance
- $iteratorInstance = ObjectFactory::createObjectByConfiguredName('shutdown_pool_iterator_class', array($this->poolEntriesInstance));
+ $iteratorInstance = ObjectFactory::createObjectByConfiguredName($visitorInstance->getVisitorMode() . '_pool_iterator_class', array($this->getPoolEntriesInstance()));
// Reset the counter
$iteratorInstance->rewind();
} // END - while
// Debug message
- $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
+ //* DEBUG: */ $this->debugOutput('POOL: ' . $visitorInstance->__toString() . ' has visited - FINISHED');
+ }
+
+ /**
+ * Gets the array from specified list
+ *
+ * @param $list The list identifier we should return
+ * @return $array The requested array
+ */
+ protected final function getArrayFromList ($list) {
+ // Get the array
+ $array = $this->getPoolEntriesInstance()->getArrayFromList($list);
+
+ // Return it
+ return $array;
}
}