Files
haiku-beta6/src/apps/debugger/target_host_interface/TargetHostInterfaceRoster.h
T
Rene Gollent 7dde731f40 Debugger: Add missing roster method implementations.
TargetHostInterfaceRoster:
- Implement counting/retrieving interfaces, as well as requesting the
  creation of a new instance.
2016-04-13 20:10:17 -04:00

59 lines
1.4 KiB
C++

/*
* Copyright 2016, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef TARGET_HOST_INTERFACE_ROSTER_H
#define TARGET_HOST_INTERFACE_ROSTER_H
#include <OS.h>
#include <Locker.h>
#include <ObjectList.h>
class Settings;
class TargetHostInterface;
class TargetHostInterfaceInfo;
class TargetHostInterfaceRoster {
public:
TargetHostInterfaceRoster();
virtual ~TargetHostInterfaceRoster();
static TargetHostInterfaceRoster* Default();
static status_t CreateDefault();
static void DeleteDefault();
bool Lock() { return fLock.Lock(); }
void Unlock() { fLock.Unlock(); }
status_t Init();
status_t RegisterInterfaceInfos();
int32 CountInterfaceInfos() const;
TargetHostInterfaceInfo*
InterfaceInfoAt(int32 index) const;
status_t CreateInterface(TargetHostInterfaceInfo* info,
Settings* settings,
TargetHostInterface*& _interface);
int32 CountActiveInterfaces() const;
TargetHostInterface* ActiveInterfaceAt(int32 index) const;
private:
typedef BObjectList<TargetHostInterfaceInfo> InfoList;
typedef BObjectList<TargetHostInterface> InterfaceList;
private:
BLocker fLock;
static TargetHostInterfaceRoster* sDefaultInstance;
InfoList fInterfaceInfos;
InterfaceList fActiveInterfaces;
};
#endif // TARGET_HOST_INTERFACE_ROSTER_H