btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / debugger / value / TypeHandlerRoster.h
blob973f202e1e705f36b8280924077f8d264058d1e4
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef TYPE_HANDLER_ROSTER_H
6 #define TYPE_HANDLER_ROSTER_H
9 #include <Locker.h>
10 #include <ObjectList.h>
13 class Type;
14 class TypeHandler;
15 class ValueNode;
16 class ValueNodeChild;
19 typedef BObjectList<TypeHandler> TypeHandlerList;
22 class TypeHandlerRoster {
23 public:
24 TypeHandlerRoster();
25 ~TypeHandlerRoster();
27 static TypeHandlerRoster* Default();
28 static status_t CreateDefault();
29 static void DeleteDefault();
31 status_t Init();
32 status_t RegisterDefaultHandlers();
34 status_t FindTypeHandler(ValueNodeChild* nodeChild,
35 Type* type, TypeHandler*& _handler);
36 // returns a reference
37 status_t CreateValueNode(ValueNodeChild* nodeChild,
38 Type* type, ValueNode*& _node);
39 // returns a reference
41 bool RegisterHandler(TypeHandler* handler);
42 void UnregisterHandler(TypeHandler* handler);
44 private:
45 BLocker fLock;
46 TypeHandlerList fTypeHandlers;
47 static TypeHandlerRoster* sDefaultInstance;
51 #endif // TYPE_HANDLER_ROSTER_H