6 #include <util/DoublyLinkedList.h>
8 #include "AttributeIndex.h"
9 #include "AttributeIterator.h"
10 #include "DataContainer.h"
17 class Attribute
: public DataContainer
,
18 public DoublyLinkedListLinkImpl
<Attribute
> {
20 Attribute(Volume
*volume
, Node
*node
, const char *name
, uint32 type
= 0);
23 status_t
InitCheck() const;
25 void SetNode(Node
*node
) { fNode
= node
; }
26 Node
*GetNode() const { return fNode
; }
28 const char *GetName() { return fName
.GetString(); }
30 void SetType(uint32 type
);
31 uint32
GetType() const { return fType
; }
33 status_t
SetSize(off_t newSize
);
34 off_t
GetSize() const { return DataContainer::GetSize(); }
36 virtual status_t
WriteAt(off_t offset
, const void *buffer
, size_t size
,
37 size_t *bytesWritten
);
40 void SetIndex(AttributeIndex
*index
, bool inIndex
);
41 AttributeIndex
*GetIndex() const { return fIndex
; }
42 bool IsInIndex() const { return fInIndex
; }
43 void GetKey(const uint8
**key
, size_t *length
);
44 void GetKey(uint8
*key
, size_t *length
);
46 // iterator management
47 void AttachAttributeIterator(AttributeIterator
*iterator
);
48 void DetachAttributeIterator(AttributeIterator
*iterator
);
49 inline DoublyLinkedList
<AttributeIterator
> *GetAttributeIteratorList()
50 { return &fIterators
; }
53 void GetAllocationInfo(AllocationInfo
&info
);
59 AttributeIndex
*fIndex
;
62 // iterator management
63 DoublyLinkedList
<AttributeIterator
> fIterators
;