btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / debugger / target_host_interface / TargetHostInterfaceRoster.h
blob9a416156cc6cb16123d6d651d634e08f66bbe7ab
1 /*
2 * Copyright 2016, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef TARGET_HOST_INTERFACE_ROSTER_H
6 #define TARGET_HOST_INTERFACE_ROSTER_H
8 #include <OS.h>
10 #include <Locker.h>
11 #include <ObjectList.h>
13 #include "TargetHostInterface.h"
16 class Settings;
17 class TargetHostInterfaceInfo;
20 class TargetHostInterfaceRoster : private TargetHostInterface::Listener {
21 public:
22 class Listener;
23 TargetHostInterfaceRoster();
24 virtual ~TargetHostInterfaceRoster();
26 static TargetHostInterfaceRoster* Default();
27 static status_t CreateDefault(Listener* listener);
28 static void DeleteDefault();
30 bool Lock() { return fLock.Lock(); }
31 void Unlock() { fLock.Unlock(); }
33 status_t Init(Listener* listener);
34 status_t RegisterInterfaceInfos();
36 int32 CountInterfaceInfos() const;
37 TargetHostInterfaceInfo*
38 InterfaceInfoAt(int32 index) const;
40 status_t CreateInterface(TargetHostInterfaceInfo* info,
41 Settings* settings,
42 TargetHostInterface*& _interface);
44 int32 CountActiveInterfaces() const;
45 TargetHostInterface* ActiveInterfaceAt(int32 index) const;
47 int32 CountRunningTeamDebuggers() const
48 { return fRunningTeamDebuggers; }
50 // TargetHostInterface::Listener
51 virtual void TeamDebuggerStarted(TeamDebugger* debugger);
52 virtual void TeamDebuggerQuit(TeamDebugger* debugger);
53 virtual void TargetHostInterfaceQuit(
54 TargetHostInterface* interface);
56 private:
57 typedef BObjectList<TargetHostInterfaceInfo> InfoList;
58 typedef BObjectList<TargetHostInterface> InterfaceList;
60 private:
61 BLocker fLock;
62 static TargetHostInterfaceRoster* sDefaultInstance;
64 int32 fRunningTeamDebuggers;
65 InfoList fInterfaceInfos;
66 InterfaceList fActiveInterfaces;
67 Listener* fListener;
71 class TargetHostInterfaceRoster::Listener {
72 public:
73 virtual ~Listener();
75 virtual void TeamDebuggerCountChanged(int32 newCount);
79 #endif // TARGET_HOST_INTERFACE_ROSTER_H