2 * Copyright 2016, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
5 #ifndef TARGET_HOST_INTERFACE_ROSTER_H
6 #define TARGET_HOST_INTERFACE_ROSTER_H
11 #include <ObjectList.h>
13 #include "TargetHostInterface.h"
17 class TargetHostInterfaceInfo
;
20 class TargetHostInterfaceRoster
: private TargetHostInterface::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
,
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
);
57 typedef BObjectList
<TargetHostInterfaceInfo
> InfoList
;
58 typedef BObjectList
<TargetHostInterface
> InterfaceList
;
62 static TargetHostInterfaceRoster
* sDefaultInstance
;
64 int32 fRunningTeamDebuggers
;
65 InfoList fInterfaceInfos
;
66 InterfaceList fActiveInterfaces
;
71 class TargetHostInterfaceRoster::Listener
{
75 virtual void TeamDebuggerCountChanged(int32 newCount
);
79 #endif // TARGET_HOST_INTERFACE_ROSTER_H