khanat-opennel-code/code/web/app/app_achievements/class/Parentum_abstract.php
StudioEtrange 91e6b23d3f ** PCH Support for NMake with VS2012
NMAKE-VS2012 Error LNK2011
while NMAKE-VS2010 does not complain
we need to link the pch.obj file
see http://msdn.microsoft.com/en-us/library/3ay26wa2(v=vs.110).aspx

** PCH Support for Ninja
Ninja need to add property
        OBJECT_DEPENDS for using PCH
        OBJECT_OUTPUTS for create PCH
see http://public.kitware.com/pipermail/cmake-developers/2012-March/003653.html
2013-09-05 17:18:01 +02:00

49 lines
No EOL
1.3 KiB
PHP

<?php
abstract class Parentum extends Node {
/*---------------------------
This class allows external access to the child-node list.
Use the NodeIterator to iterate through the list since
the numeric array keys might have gaps due to node removals!
Once init() has been called, an AVLTree is used to support the
functions removeChild() and findChild(). init() must be called
before adding any nodes!
---------------------------*/
protected $nodes;
function Parentum() {
parent::__construct();
$this->nodes = new DLL(); // Doubly Linked List
}
abstract protected function makeChild($args); // overwriteable child generator; allows to define child type (eg.: admin classes that inherit from base class)
function isEmpty() {
return $this->nodes->isEmpty();
}
function addChild($data,$b = null) {
$this->nodes->addNode($data,$b);
}
function removeChild($id) {
$this->nodes->removeNode($id);
}
function getChildByID($id) { // returns a DLL node
return $this->nodes->findNode($id);
}
function getChildDataByID($id) { // returns the actual content of the found DLL node
$tmp = $this->getChildByID($id);
if($tmp != null) {
return $tmp->data;
}
return null;
}
function getIterator() {
return $this->nodes->getIterator();
}
}
?>