*/
private static $configInstance = NULL;
+ /**
+ * Call-back instance (unused)
+ */
+ private $callbackInstance = NULL;
+
// Some constants for the configuration system
const EXCEPTION_CONFIG_KEY_IS_EMPTY = 0x130;
const EXCEPTION_CONFIG_KEY_WAS_NOT_FOUND = 0x131;
return $equals;
}
+ /**
+ * Setter for call-back instance
+ *
+ * @param $callbackInstance An instance of a FrameworkInterface class
+ * @return void
+ */
+ public function setCallbackInstance (FrameworkInterface $callbackInstance) {
+ $this->callbackInstance = $callbackInstance;
+ }
+
}
*/
private $registryInstance = NULL;
+ /**
+ * Call-back instance
+ */
+ private $callbackInstance = NULL;
+
/**
* Thousands separator
*/
return $this->registryInstance;
}
+ /**
+ * Setter for call-back instance
+ *
+ * @param $callbackInstance An instance of a FrameworkInterface class
+ * @return void
+ */
+ public final function setCallbackInstance (FrameworkInterface $callbackInstance) {
+ $this->callbackInstance = $callbackInstance;
+ }
+
+ /**
+ * Getter for call-back instance
+ *
+ * @return $callbackInstance An instance of a FrameworkInterface class
+ */
+ protected final function getCallbackInstance () {
+ return $this->callbackInstance;
+ }
+
/**
* Setter for command name
*
// Import framework stuff
use CoreFramework\Object\BaseFrameworkSystem;
+// Import SPL stuff
+use \Iterator;
+
/**
* A general iterator
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class BaseIterator extends BaseFrameworkSystem {
+abstract class BaseIterator extends BaseFrameworkSystem implements Iterator {
/**
* Protected constructor
*
namespace CoreFramework\Iterator\Registry;
// Import framework stuff
+use CoreFramework\Generic\FrameworkInterface;
+use CoreFramework\Generic\NullPointerException;
use CoreFramework\Iterator\BaseIterator;
use CoreFramework\Registry\Register;
+use CoreFramework\Registry\Registerable;
+use CoreFramework\Registry\Sub\SubRegistry;
// Import SPL stuff
-use \Iterator;
+use \LogicException;
/**
* A Registry iterator
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class RegistryIterator extends BaseIterator implements Iterator {
+class RegistryIterator extends BaseIterator implements IteratableRegistry {
+ /**
+ * All found registry keys
+ */
+ private $registryKeys = array();
+
+ /**
+ * Current array key
+ */
+ private $key = NULL;
+
+ /**
+ * Valid status (default: not valid)
+ */
+ private $valid = FALSE;
+
/**
* Protected constructor
*
return $iteratorInstance;
}
+ /**
+ * Initializes this iterator by scanning over the registry for all keys.
+ *
+ * @param $callbackInstance An instance of a FrameworkInterface class to call back (optional)
+ * @param $criteriaKey Criteria key (optional)
+ * @param $criteriaMethod Method to call back (optional)
+ * @return void
+ * @throws LogicException If a registry entry does not implement Registerable
+ * @throws NullPointerException If criteriaKey or criteriaMethod is not set but a call-back instance is set
+ */
+ public function initIterator (FrameworkInterface $callbackInstance = NULL, $criteriaKey = NULL, $criteriaMethod = NULL) {
+ // Is the call-back instance set?
+ if ($callbackInstance instanceof FrameworkInterface) {
+ // Then also criteria key and method name must be given
+ if (is_null($criteriaKey)) {
+ // Throw NPE
+ throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+ } elseif (is_null($criteriaMethod)) {
+ // Throw NPE
+ throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+ }
+
+ // Set all
+ $iteratorInstance->setCallbackInstance($callbackInstance);
+ $iteratorInstance->setCriteriaKey($criteriaKey);
+ } // END - if
+
+ // Get generic registry entries from it
+ $entries = $this->getRegistryInstance()->getGenericRegistry();
+
+ // Init registry keys array
+ $this->registryKeys['generic'] = array();
+
+ // Anything in there?
+ if (count($entries) > 0) {
+ // Debugging:
+ /* DEBUG-DIE: */ die(sprintf('[%s:%d]: entries=%s', __METHOD__, __LINE__, print_r($entries, TRUE)));
+ } // END - if
+
+ // Get instance registry entries from it
+ $entries = $this->getRegistryInstance()->getInstanceRegistry();
+
+ // Init registry keys array
+ $this->registryKeys['instance'] = array();
+
+ // Anything in there?
+ if (count($entries) > 0) {
+ // Then run over all
+ foreach ($entries as $key => $entry) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s,entry[]=%s', $key, gettype($entry)));
+
+ // Is it 'socket_registry' ?
+ if ($key == 'socket_registry') {
+ // Skip this entry
+ continue;
+ } // END - if
+
+ // Is it an instance of a sub-registry?
+ if ($entry instanceof SubRegistry) {
+ // Get iterator from this instance
+ $iteratorInstance = $entry->getIterator();
+
+ // Debugging:
+ //* DEBUG-DIE: */ die(sprintf('[%s:%d]: key=%s,iteratorInstance=%s', __METHOD__, __LINE__, $key, print_r($iteratorInstance, TRUE)));
+
+ // Get all keys
+ $keys = $iteratorInstance->getRegistryKeys();
+
+ // Should be there
+ if (!isset($keys['instance'])) {
+ // Should not happen
+ throw new LogicException(sprintf('key=%s,keys[instance] is not set.', $key));
+ } // END - if
+
+ // Add all sub-registry keys to this registry keys array
+ $this->registryKeys['instance'][$key] = $keys['instance'];
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s,keys=%s', $key, print_r($this->registryKeys['instance'][$key], TRUE)));
+
+ // Skip below code
+ continue;
+ } elseif (!($entry instanceof Registerable)) {
+ // Not registerable?!
+ throw new LogicException(sprintf('entry[]=%s does not implement Registerable.', gettype($entry)));
+ } elseif (is_null($this->key)) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: Setting key=%s ...', $key));
+
+ // Init key/valid
+ $this->key = $key;
+ $this->valid = TRUE;
+ }
+
+ // Debugging:
+ //* DEBUG-DIE: */ die(sprintf('[%s:%d]: key=%s,entry=%s', __METHOD__, __LINE__, $key, print_r($entry, TRUE)));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('REGISTRY-ITERATOR[instance]: key=%s,entry[]=%s - Adding ...', $key, gettype($entry)));
+
+ // Add key to array
+ $this->registryKeys['instance'][$key] = array();
+ } // END - foreach
+ } // END - if
+ }
+
+ /**
+ * Getter for all registry keys (array)
+ *
+ * @return $registryKeys Registry keys
+ */
+ public final function getRegistryKeys () {
+ // Return it
+ return $this->registryKeys;
+ }
+
/**
* Getter for current value from group or generic
*
* @return $key Current key in iteration
*/
public function key () {
- // Default is null
- $key = null;
-
- $this->partialStub('Please implement this method.');
-
// Return it
- return $key;
+ return $this->key;
}
/**
* @return void
*/
public function rewind () {
- $this->partialStub('Please implement this method.');
+ // Debugging:
+ /* DEBUG-DIE: */ die(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE)));
}
/**
* Checks wether the current entry is valid (not at the end of the list)
*
- * @return void
+ * @return $valid Whether the current key is still valid
*/
public function valid () {
- $this->partialStub('Please implement this method.');
+ // Return flag
+ return $this->valid;
}
}
const EXCEPTION_GROUP_NOT_FOUND = 0xf21;
const EXCEPTION_INVALID_HASH = 0xf22;
- /**
- * Call-back instance
- */
- private $callbackInstance = NULL;
-
/**
* List groups array
*/
parent::__construct($className);
}
- /**
- * Setter for call-back instance
- *
- * @param $callbackInstance An instance of a FrameworkInterface class
- * @return void
- */
- public final function setCallbackInstance (FrameworkInterface $callbackInstance) {
- $this->callbackInstance = $callbackInstance;
- }
-
/**
* Getter for iterator instance from this list
*
} elseif ((is_array($entry)) && (isset($entry['id']))) {
// Supported array found
$entry2 = crc32($entry['id']) . ':' . count($entry);
- } elseif (($this->callbackInstance instanceof FrameworkInterface) && (method_exists($this->callbackInstance, 'generateListHashFromEntry'))) {
+ } elseif (($this->getCallbackInstance() instanceof FrameworkInterface) && (method_exists($this->getCallbackInstance(), 'generateListHashFromEntry'))) {
// Call it instead
- $entry2 = $this->callbackInstance->generateListHashFromEntry($entry);
+ $entry2 = $this->getCallbackInstance()->generateListHashFromEntry($entry);
} else {
// Unsupported type detected
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST[' . __METHOD__ . ':' . __LINE__ . ']: Entry type ' . gettype($entry) . ' is unsupported (this->callbackInstance=' . $this->callbackInstance . ').');
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-LIST[' . __METHOD__ . ':' . __LINE__ . ']: Entry type ' . gettype($entry) . ' is unsupported (this->callbackInstance=' . $this->getCallbackInstance() . ').');
// At least take all keys from array
$entry2 = gettype($entry) . ':' . implode(':', array_keys($entry));
parent::__construct($className);
// Init generic arrays
- $this->initGenericArrayGroup('raw', 'generic');
- $this->initGenericArrayGroup('raw', 'instance');
+ $this->initGenericArrayGroup('registry', 'generic');
+ $this->initGenericArrayGroup('registry', 'instance');
}
/**
* @return $iteratorInstance An instance of a Iterator class
*/
public function getIterator () {
- // Instance + return it
- return ObjectFactory::createObjectByConfiguredName('registry_iterator_class', array($this));
+ // Is it set?
+ if (is_null($this->getIteratorInstance())) {
+ // Then instance it
+ $iteratorInstance = ObjectFactory::createObjectByConfiguredName('registry_iterator_class', array($this));
+
+ // ... and set it here
+ $this->setIteratorInstance($iteratorInstance);
+ } else {
+ // Use set iterator
+ $iteratorInstance = $this->getIteratorInstance();
+ }
+
+ // Return it
+ return $iteratorInstance;
}
/**
$this->setGenericArrayKey('registry', 'instance', $instanceKey, $objectInstance);
}
+ /**
+ * Getter for whole generic registry
+ *
+ * @return $instanceRegistry The whole generic registry array
+ */
+ public final function getGenericRegistry () {
+ return $this->getGenericSubArray('registry', 'generic');
+ }
+
/**
* Getter for whole instance registry
*
assert(!is_array($key));
// Push it
- $this->pushValueToGenericArrayKey('raw', 'generic', $key, $value);
+ $this->pushValueToGenericArrayKey('registry', 'generic', $key, $value);
}
/**
assert(!is_array($key));
// Default is whole array
- $entries = $this->getGenericArray('raw');
+ $entries = $this->getGenericArray('registry');
// Is $key set?
if (!is_null($key)) {
// Then use this entry
- $entries = $this->getGenericArrayKey('raw', 'generic', $key);
+ $entries = $this->getGenericArrayKey('registry', 'generic', $key);
} // END - if
// Return the array
*/
function isFieldSet ($fieldName);
+ /**
+ * Setter for call-back instance
+ *
+ * @param $callbackInstance An instance of a FrameworkInterface class
+ * @return void
+ */
+ function setCallbackInstance (FrameworkInterface $callbackInstance);
+
/**
* Checks whether an object equals this object. You should overwrite this
* method to implement own equality checks
+++ /dev/null
-<?php
-// Own namespace
-namespace CoreFramework\Iterator\Filesystem;
-
-// Import SPL stuff
-use \SeekableIterator;
-
-/**
- * An interface for seekable iterators which also allow to write to the file
- * in different ways.
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-interface SeekableWritableFileIterator extends SeekableIterator {
- /**
- * Seeks to given position
- *
- * @param $seekPosition Seek position in file
- * @return $status Status of this operation
- */
- function seek ($seekPosition);
-
- /**
- * Size of file stack
- *
- * @return $size Size (in bytes) of file
- */
- function size ();
-
- /**
- * Reads given amount of bytes from file.
- *
- * @param $bytes Amount of bytes to read
- * @return $data Data read from file
- */
- function read ($bytes);
-
- /**
- * Analyzes entries in index file. This will count all found (and valid)
- * entries, mark invalid as damaged and count gaps ("fragmentation"). If
- * only gaps are found, the file is considered as "virgin" (no entries).
- *
- * @return void
- */
- function analyzeFile ();
-
- /**
- * Checks whether the file header is initialized
- *
- * @return $isInitialized Whether the file header is initialized
- */
- function isFileHeaderInitialized ();
-
- /**
- * Creates the assigned file
- *
- * @return void
- */
- function createFileHeader ();
-
- /**
- * Pre-allocates file (if enabled) with some space for later faster write access.
- *
- * @param $type Type of the file
- * @return void
- */
- function preAllocateFile ($type);
-
- /**
- * Initializes counter for valid entries, arrays for damaged entries and
- * an array for gap seek positions. If you call this method on your own,
- * please re-analyze the file structure. So you are better to call
- * analyzeFile() instead of this method.
- *
- * @return void
- */
- function initCountersGapsArray ();
-
- /**
- * Getter for header size
- *
- * @return $totalEntries Size of file header
- */
- function getHeaderSize ();
-
- /**
- * Setter for header size
- *
- * @param $headerSize Size of file header
- * @return void
- */
- function setHeaderSize ($headerSize);
-
- /**
- * Getter for header array
- *
- * @return $totalEntries Size of file header
- */
- function getHeader ();
-
- /**
- * Setter for header
- *
- * @param $header Array for a file header
- * @return void
- */
- function setHeader (array $header);
-
- /**
- * Updates seekPosition attribute from file to avoid to much access on file.
- *
- * @return void
- */
- function updateSeekPosition ();
-
- /**
- * Getter for total entries
- *
- * @return $totalEntries Total entries in this file
- */
- function getCounter ();
-
- /**
- * "Getter" for file size
- *
- * @return $fileSize Size of currently loaded file
- */
- function getFileSize ();
-
- /**
- * Writes data at given position
- *
- * @param $seekPosition Seek position
- * @param $data Data to be written
- * @param $flushHeader Whether to flush the header (default: flush)
- * @return void
- */
- function writeData ($seekPosition, $data, $flushHeader = true);
-
- /**
- * Getter for seek position
- *
- * @return $seekPosition Current seek position (stored here in object)
- */
- function getSeekPosition ();
-
- /**
- * Writes given value to the file and returns a hash and gap position for it
- *
- * @param $groupId Group identifier
- * @param $value Value to be added to the stack
- * @return $data Hash and gap position
- */
- function writeValueToFile ($groupId, $value);
-
- /**
- * Writes given raw data to the file and returns a gap position and length
- *
- * @param $groupId Group identifier
- * @param $hash Hash from encoded value
- * @param $encoded Encoded value to be written to the file
- * @return $data Gap position and length of the raw data
- */
- function writeDataToFreeGap ($groupId, $hash, $encoded);
-
- /**
- * Searches for next suitable gap the given length of data can fit in
- * including padding bytes.
- *
- * @param $length Length of raw data
- * @return $seekPosition Found next gap's seek position
- */
- function searchNextGap ($length);
-
-}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+// Own namespace
+namespace CoreFramework\Iterator\Filesystem;
+
+// Import SPL stuff
+use \SeekableIterator;
+
+/**
+ * An interface for seekable iterators which also allow to write to the file
+ * in different ways.
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface SeekableWritableFileIterator extends SeekableIterator {
+ /**
+ * Seeks to given position
+ *
+ * @param $seekPosition Seek position in file
+ * @return $status Status of this operation
+ */
+ function seek ($seekPosition);
+
+ /**
+ * Size of file stack
+ *
+ * @return $size Size (in bytes) of file
+ */
+ function size ();
+
+ /**
+ * Reads given amount of bytes from file.
+ *
+ * @param $bytes Amount of bytes to read
+ * @return $data Data read from file
+ */
+ function read ($bytes);
+
+ /**
+ * Analyzes entries in index file. This will count all found (and valid)
+ * entries, mark invalid as damaged and count gaps ("fragmentation"). If
+ * only gaps are found, the file is considered as "virgin" (no entries).
+ *
+ * @return void
+ */
+ function analyzeFile ();
+
+ /**
+ * Checks whether the file header is initialized
+ *
+ * @return $isInitialized Whether the file header is initialized
+ */
+ function isFileHeaderInitialized ();
+
+ /**
+ * Creates the assigned file
+ *
+ * @return void
+ */
+ function createFileHeader ();
+
+ /**
+ * Pre-allocates file (if enabled) with some space for later faster write access.
+ *
+ * @param $type Type of the file
+ * @return void
+ */
+ function preAllocateFile ($type);
+
+ /**
+ * Initializes counter for valid entries, arrays for damaged entries and
+ * an array for gap seek positions. If you call this method on your own,
+ * please re-analyze the file structure. So you are better to call
+ * analyzeFile() instead of this method.
+ *
+ * @return void
+ */
+ function initCountersGapsArray ();
+
+ /**
+ * Getter for header size
+ *
+ * @return $totalEntries Size of file header
+ */
+ function getHeaderSize ();
+
+ /**
+ * Setter for header size
+ *
+ * @param $headerSize Size of file header
+ * @return void
+ */
+ function setHeaderSize ($headerSize);
+
+ /**
+ * Getter for header array
+ *
+ * @return $totalEntries Size of file header
+ */
+ function getHeader ();
+
+ /**
+ * Setter for header
+ *
+ * @param $header Array for a file header
+ * @return void
+ */
+ function setHeader (array $header);
+
+ /**
+ * Updates seekPosition attribute from file to avoid to much access on file.
+ *
+ * @return void
+ */
+ function updateSeekPosition ();
+
+ /**
+ * Getter for total entries
+ *
+ * @return $totalEntries Total entries in this file
+ */
+ function getCounter ();
+
+ /**
+ * "Getter" for file size
+ *
+ * @return $fileSize Size of currently loaded file
+ */
+ function getFileSize ();
+
+ /**
+ * Writes data at given position
+ *
+ * @param $seekPosition Seek position
+ * @param $data Data to be written
+ * @param $flushHeader Whether to flush the header (default: flush)
+ * @return void
+ */
+ function writeData ($seekPosition, $data, $flushHeader = true);
+
+ /**
+ * Getter for seek position
+ *
+ * @return $seekPosition Current seek position (stored here in object)
+ */
+ function getSeekPosition ();
+
+ /**
+ * Writes given value to the file and returns a hash and gap position for it
+ *
+ * @param $groupId Group identifier
+ * @param $value Value to be added to the stack
+ * @return $data Hash and gap position
+ */
+ function writeValueToFile ($groupId, $value);
+
+ /**
+ * Writes given raw data to the file and returns a gap position and length
+ *
+ * @param $groupId Group identifier
+ * @param $hash Hash from encoded value
+ * @param $encoded Encoded value to be written to the file
+ * @return $data Gap position and length of the raw data
+ */
+ function writeDataToFreeGap ($groupId, $hash, $encoded);
+
+ /**
+ * Searches for next suitable gap the given length of data can fit in
+ * including padding bytes.
+ *
+ * @param $length Length of raw data
+ * @return $seekPosition Found next gap's seek position
+ */
+ function searchNextGap ($length);
+
+}
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+// Own namespace
+namespace CoreFramework\Iterator\Registry;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkInterface;
+
+// Import SPL stuff
+use \Iterator;
+
+/**
+ * A registry iterator interface
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface IteratableRegistry extends FrameworkInterface, Iterator {
+
+ /**
+ * Initializes this iterator by scanning over the registry for all keys.
+ *
+ * @return void
+ * @throws LogicException If a registry entry does not implement Registerable
+ * @throws NullPointerException If criteriaKey or criteriaMethod is not set but a call-back instance is set
+ */
+ function initIterator (FrameworkInterface $callbackInstance = NULL, $criteriaKey = NULL, $criteriaMethod = NULL);
+
+}
*/
function addInstance ($instanceKey, Registerable $objectInstance);
+ /**
+ * Getter for whole generic registry
+ *
+ * @return $instanceRegistry The whole generic registry array
+ */
+ function getGenericRegistry ();
+
+ /**
+ * Getter for whole instance registry
+ *
+ * @return $instanceRegistry The whole instance registry array
+ */
+ function getInstanceRegistry ();
+
+ /**
+ * Adds a new entry to the given list name. If you want to add objects
+ * please use addInstance() and getInstance() instead.
+ *
+ * @param $key The key to identify the whole list
+ * @param $value The value to be stored
+ * @return void
+ */
+ function addEntry ($key, $value);
+
+ /**
+ * Getter for entries or "sub entries"
+ *
+ * @return $entries An array with entries from this registry
+ */
+ function getEntries ($key = NULL);
+
+ /**
+ * "Getter" for an array of all entries for given key
+ *
+ * @param $arrayKey The array (key) to look in
+ * @param $lookFor The key to look for
+ * @return $entry An array with all keys
+ */
+ function getArrayFromKey ($arrayKey, $lookFor);
+
/**
* Gets a registered instance or null if not found
*
* @param $instanceKey The key to identify the instance
* @return $objectInstance An instance we shall store
+ * @throws NullPointerException If the requested key is not found
*/
function getInstance ($instanceKey);