Bool testhash::Parent::insertBeforeTableListChild(const Child & child, const Child & next) const { if(!child.isExists() || !next.isExists()) return false; Child prev = next.getPrevParentTableListChild(); next.setPrevParentTableListChild(child); child.setNextParentTableListChild(next); child.setPrevParentTableListChild(prev); if(prev.isValid()) prev.setNextParentTableListChild(child); else setFirstTableListChild(child); setNumTableListChilds(getNumTableListChilds() + 1); child.setupTableListParentHandler(); return true; }
Bool testhash::Parent::insertAfterTableListChild(const Child & child, const Child & prev) const { if( !child.isExists() || !prev.isExists()) return false; Child next = prev.getNextParentTableListChild(); prev.setNextParentTableListChild(child); child.setPrevParentTableListChild(prev); child.setNextParentTableListChild(next); if(next.isValid()) next.setPrevParentTableListChild(child); else setLastTableListChild(child); setNumTableListChilds(getNumTableListChilds() + 1); child.setupTableListParentHandler(); return true; }
Bool testhash::Parent::pushFrontTableListChild(const Child & child) const { if(!child.isExists()) return false; Child first_child = getFirstTableListChild(); child.setNextParentTableListChild(first_child); if(first_child.isValid()) first_child.setPrevParentTableListChild(child); else setLastTableListChild(child); child.setPrevParentTableListChild(Child()); setFirstTableListChild(child); setNumTableListChilds(getNumTableListChilds() + 1); child.setupTableListParentHandler(); return true; }