* @return $isset Whether the group is valid
*/
public function isGroupSet ($groupName) {
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName);
return isset($this->listGroups[$groupName]);
}
* @throws ListGroupAlreadyAddedException If the given group is already added
*/
public function addGroup ($groupName) {
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName . ' - START');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - CALLED!');
// Is the group already added?
if ($this->isGroupSet($groupName)) {
// Throw the exception here
// Add the group which is a simple array
$this->listGroups[$groupName] = ObjectFactory::createObjectByConfiguredName('list_group_class');
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName . ' - FINISHED');
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - EXIT!');
}
/**
* @throws NoListGroupException If the given group is not found
*/
public function addInstance ($groupName, $subGroup, Visitable $visitableInstance) {
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName . '/' . $subGroup . ' - START');
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',subGroup=' . $subGroup . ',visitableInstance=' . $visitableInstance->__toString() . ' - CALLED!');
+
// Is the group there?
if (!$this->isGroupSet($groupName)) {
// Throw the exception here
// Generate the hash
$hash = $this->generateHash($groupName, $subGroup, $visitableInstance);
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',subGroup=' . $subGroup . ',hash=' . $hash . ' - Calling addEntry() ...');
+
// Now add it to the group list and hash it
- $this->listGroups[$groupName]->addEntry($subGroup, $hash);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',this->listGroups[' . $groupName . ']=' . $this->listGroups[$groupName]->__toString());
+ //$this->listGroups[$groupName]->addEntry($subGroup, $hash);
// Add the hash to the index
array_push($this->listIndex, $hash);
// Add the instance itself to the list
$this->listEntries[$hash] = $visitableInstance;
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.': '.$groupName . '/' . $subGroup . ' - FINISHED');
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',subGroup=' . $subGroup . ' - EXIT!');
}
/**
* @throws NoListGroupException If the given group is not found
*/
public final function getArrayFromList ($list) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',list[' . gettype($list) . ']=' . $list . ' - CALLED!');
+
// Is the group there?
if ((!is_null($list)) && (!$this->isGroupSet($list))) {
// Throw the exception here
// Walk through all entries
foreach ($this->listIndex as $hash) {
- //* DEBUG: */ print __METHOD__.':hash='.$hash.chr(10);
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash);
+
// Is the list entry set?
if ($this->isHashValid($hash)) {
// Add it
array_push($array, $this->listEntries[$hash]);
- //* DEBUG: */ print __METHOD__.": ADDED!\n";
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash . ',array(' . count($array) . ')=' . print_r($array, TRUE) . ' - ADDED!');
} // END - if
} // END - foreach
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',list[' . gettype($list) . ']=' . $list . ',array()=' . count($array) . ' - EXIT!');
+
// Return it
return $array;
}
* @throws NoListGroupException If the given group is not found
*/
public function addEntry ($groupName, $entry) {
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - START');
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - CALLED!');
+
// Is the group already added?
if (!$this->isGroupSet($groupName)) {
// Throw the exception here
// Generate hash
$hash = $this->generateHash($groupName, $groupName, $entry);
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-LIST[' . __METHOD__ . ':' . __LINE__ . ']: groupName=' . $groupName . ', entry=' . $entry . ', hash=' . $hash);
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',entry=' . print_r($entry, TRUE) . ', hash=' . $hash);
// Add the hash to the index
array_push($this->listIndex, $hash);
- //* DEBUG: */ print $groupName.'/'.$this->count().chr(10);
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',listEntries()=' . count($this->listEntries));
// Now add the entry to the list
$this->listEntries[$hash] = $entry;
- //* DEBUG: */ print $groupName.'/'.count($this->listEntries).chr(10);
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - FINISHED');
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',listEntries()=' . count($this->listEntries) . ' - EXIT!');
}
/**
* @throws NoListGroupException If the given group is not found
*/
public function removeEntry ($groupName, $entry) {
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - START');
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - CALLED!');
+
// Is the group already added?
if (!$this->isGroupSet($groupName)) {
// Throw the exception here
// Generate hash
$hash = $this->generateHash($groupName, $groupName, $entry);
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-LIST[' . __METHOD__ . ':' . __LINE__ . ']: groupName=' . $groupName . ', entry=' . $entry . ', hash=' . $hash);
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',entry=' . $entry . ', hash=' . $hash);
// Remove it from the list ...
unset($this->listEntries[$hash]);
// ... and hash list as well
unset($this->listIndex[array_search($hash, $this->listIndex)]);
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.'('.$this->__toString().'): '.$groupName . ' - FINISHED');
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ' - EXIT!');
}
/**
* @return $entries The array with all entries
* @throws NoListGroupException If the specified group is invalid
*/
- public function getArrayFromGroup ($groupName) {
+ public function getArrayFromProtocolInstance ($groupName) {
// Is the group valid?
if (!$this->isGroupSet($groupName)) {
// Throw the exception here
}
}
-//
+// [EOF]
?>