1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "PackageDirectory.h" 8 9 10 PackageDirectory::PackageDirectory(Package* package, mode_t mode) 11 : 12 PackageNode(package, mode) 13 { 14 } 15 16 17 PackageDirectory::~PackageDirectory() 18 { 19 while (PackageNode* child = fChildren.RemoveHead()) 20 child->ReleaseReference(); 21 } 22 23 24 void 25 PackageDirectory::AddChild(PackageNode* node) 26 { 27 fChildren.Add(node); 28 node->AcquireReference(); 29 } 30 31 32 void 33 PackageDirectory::RemoveChild(PackageNode* node) 34 { 35 fChildren.Remove(node); 36 node->ReleaseReference(); 37 } 38