btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / servers / package / VolumeState.h
blob829ee07356c32c6af1c4267616812476856662c9
1 /*
2 * Copyright 2013-2014, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
7 */
8 #ifndef VOLUME_STATE_H
9 #define VOLUME_STATE_H
12 #include "Package.h"
15 class VolumeState {
16 public:
17 VolumeState();
18 ~VolumeState();
20 bool Init();
22 Package* FindPackage(const char* name) const;
23 Package* FindPackage(const node_ref& nodeRef) const;
25 PackageFileNameHashTable::Iterator ByFileNameIterator() const;
26 PackageNodeRefHashTable::Iterator ByNodeRefIterator() const;
28 void AddPackage(Package* package);
29 void RemovePackage(Package* package);
31 void SetPackageActive(Package* package, bool active);
33 void ActivationChanged(
34 const PackageSet& activatedPackage,
35 const PackageSet& deactivatePackages);
37 VolumeState* Clone() const;
39 private:
40 void _RemovePackage(Package* package);
42 private:
43 PackageFileNameHashTable fPackagesByFileName;
44 PackageNodeRefHashTable fPackagesByNodeRef;
48 inline Package*
49 VolumeState::FindPackage(const char* name) const
51 return fPackagesByFileName.Lookup(name);
55 inline Package*
56 VolumeState::FindPackage(const node_ref& nodeRef) const
58 return fPackagesByNodeRef.Lookup(nodeRef);
62 inline PackageFileNameHashTable::Iterator
63 VolumeState::ByFileNameIterator() const
65 return fPackagesByFileName.GetIterator();
69 inline PackageNodeRefHashTable::Iterator
70 VolumeState::ByNodeRefIterator() const
72 return fPackagesByNodeRef.GetIterator();
76 #endif // VOLUME_STATE_H