vfs: check userland buffers before reading them.
[haiku.git] / src / kits / debugger / debug_info / ImageDebugLoadingStateHandlerRoster.h
blob6731ae22c28fc96a655e6c5f475c2620782a3593
1 /*
2 * Copyright 2014, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef IMAGE_DEBUG_LOADING_STATE_HANDLER_ROSTER_H
6 #define IMAGE_DEBUG_LOADING_STATE_HANDLER_ROSTER_H
9 #include <Locker.h>
10 #include <ObjectList.h>
13 class ImageDebugLoadingStateHandler;
14 class SpecificImageDebugInfoLoadingState;
17 typedef BObjectList<ImageDebugLoadingStateHandler> LoadingStateHandlerList;
20 class ImageDebugLoadingStateHandlerRoster {
21 public:
22 ImageDebugLoadingStateHandlerRoster();
23 ~ImageDebugLoadingStateHandlerRoster();
25 static ImageDebugLoadingStateHandlerRoster*
26 Default();
27 static status_t CreateDefault();
28 static void DeleteDefault();
30 status_t Init();
31 status_t RegisterDefaultHandlers();
33 status_t FindStateHandler(
34 SpecificImageDebugInfoLoadingState* state,
35 ImageDebugLoadingStateHandler*&
36 _handler);
37 // returns a reference
39 bool RegisterHandler(
40 ImageDebugLoadingStateHandler*
41 handler);
42 void UnregisterHandler(
43 ImageDebugLoadingStateHandler*
44 handler);
46 private:
47 BLocker fLock;
48 LoadingStateHandlerList
49 fStateHandlers;
50 static ImageDebugLoadingStateHandlerRoster*
51 sDefaultInstance;
55 #endif // IMAGE_DEBUG_LOADING_STATE_HANDLER_ROSTER_H