btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / debugger / files / LocatableEntry.h
blob20bf255b5715b714267b7b9908a5ff96d08f058b
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef LOCATABLE_ENTRY_H
6 #define LOCATABLE_ENTRY_H
8 #include <String.h>
10 #include <Referenceable.h>
11 #include <util/DoublyLinkedList.h>
12 #include <util/OpenHashTable.h>
15 enum locatable_entry_state {
16 LOCATABLE_ENTRY_UNLOCATED,
17 LOCATABLE_ENTRY_LOCATED_IMPLICITLY,
18 LOCATABLE_ENTRY_LOCATED_EXPLICITLY
22 class LocatableDirectory;
23 class LocatableEntry;
26 class LocatableEntryOwner {
27 public:
28 virtual ~LocatableEntryOwner();
30 virtual bool Lock() = 0;
31 virtual void Unlock() = 0;
33 virtual void LocatableEntryUnused(LocatableEntry* entry) = 0;
37 class LocatableEntry : public BReferenceable,
38 public DoublyLinkedListLinkImpl<LocatableEntry> {
39 public:
40 LocatableEntry(LocatableEntryOwner* owner,
41 LocatableDirectory* parent);
42 ~LocatableEntry();
44 LocatableDirectory* Parent() const { return fParent; }
45 virtual const char* Name() const = 0;
47 // mutable (requires locking)
48 locatable_entry_state State() const { return fState; }
49 virtual bool GetLocatedPath(BString& _path) const = 0;
50 virtual void SetLocatedPath(const BString& path,
51 bool implicit) = 0;
53 protected:
54 virtual void LastReferenceReleased();
56 protected:
57 LocatableEntryOwner* fOwner;
58 LocatableDirectory* fParent;
59 locatable_entry_state fState;
61 public:
62 LocatableEntry* fNext;
66 typedef DoublyLinkedList<LocatableEntry> LocatableEntryList;
69 #endif // LOCATABLE_ENTRY_H