예제 #1
0
 ~TrieNode() {
     if(ChildCount == 0) return;
     else if(ChildCount > MAX_LIST_ELEMENTS) {
         DeallocateArray();
     }
     else DeallocateList(ChildrenListHead, true);
 }
예제 #2
0
    void DeallocateList(TrieList* node, bool deallocateNodes) {
        if(node->Next) {
            DeallocateList(node->Next, deallocateNodes);
        }

        if(deallocateNodes) {
            delete node->Node;
        }

        delete node;
    }
예제 #3
0
    void ConvertListToArray() {
        assert(ChildrenListHead != nullptr);

        TrieNode** array = AllocateArray();
        TrieList* listNode = ChildrenListHead;

        while(listNode) {
            array[listNode->Value] = listNode->Node;
            listNode = listNode->Next;
        }

        DeallocateList(ChildrenListHead, false);
        ChildrenArray = array;
    }
void CDerivedDisplaySettingsListView::SetAllItems( void )
{
DeallocateList();
AllocateList();
SetList();
};