xref: /haiku/src/add-ons/kernel/file_systems/packagefs/indices/AttributeIndexer.h (revision 7c234361eb70458273aba20f16643d7514536f1c)
1 /*
2  * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef ATTRIBUTE_INDEXER_H
6 #define ATTRIBUTE_INDEXER_H
7 
8 
9 #include <SupportDefs.h>
10 
11 #include "String.h"
12 
13 
14 class AttributeIndex;
15 struct AttributeIndexTreeValue;
16 class IndexedAttributeOwner;
17 
18 
19 class AttributeIndexer {
20 public:
21 								AttributeIndexer(AttributeIndex* index);
22 								~AttributeIndexer();
23 
24 			status_t			CreateCookie(IndexedAttributeOwner* owner,
25 									void* attributeCookie, uint32 attributeType,
26 									size_t attributeSize, void*& _data,
27 									size_t& _toRead);
28 			void				DeleteCookie();
29 
Cookie()30 			AttributeIndexTreeValue* Cookie() const
31 									{ return fCookie; }
32 
IndexName()33 			const String&		IndexName() const
34 									{ return fIndexName; }
35 
36 private:
37 			AttributeIndex*		fIndex;
38 			const String&		fIndexName;
39 			uint32				fIndexType;
40 			AttributeIndexTreeValue* fCookie;
41 };
42 
43 
44 #endif	// ATTRIBUTE_INDEX_H
45