// Entry.h #ifndef ENTRY_H #define ENTRY_H #include #include #include #include "String.h" class AllocationInfo; class Directory; class EntryIterator; class Node; class Entry : public DoublyLinkedListLinkImpl { public: Entry(const char *name, Node *node = NULL, Directory *parent = NULL); ~Entry(); status_t InitCheck() const; inline void SetParent(Directory *parent) { fParent = parent; } Directory *GetParent() const { return fParent; } // inline void SetNode(Node *node) { fNode = node; } status_t Link(Node *node); status_t Unlink(); Node *GetNode() const { return fNode; } status_t SetName(const char *newName); inline const char *GetName() const { return fName.GetString(); } // inline Volume *GetVolume() const { return fVolume; } inline DoublyLinkedListLink *GetReferrerLink() { return &fReferrerLink; } // entry iterator management void AttachEntryIterator(EntryIterator *iterator); void DetachEntryIterator(EntryIterator *iterator); inline DoublyLinkedList *GetEntryIteratorList() { return &fIterators; } // debugging void GetAllocationInfo(AllocationInfo &info); private: Directory *fParent; Node *fNode; String fName; DoublyLinkedListLink fReferrerLink; // iterator management DoublyLinkedList fIterators; }; // GetNodeReferrerLink class GetNodeReferrerLink { private: typedef DoublyLinkedListLink Link; public: inline Link *operator()(Entry *entry) const { return entry->GetReferrerLink(); } }; #endif // ENTRY_H