xref: /haiku/src/add-ons/kernel/file_systems/packagefs/package/PackageDirectory.cpp (revision 95c9effd68127df2dce202d5e254a7c86560010a)
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