mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 02:35:03 +01:00
c9fc1d5064
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31143 a95241bf-73f2-0310-859d-f6bbb57e9c96
81 lines
1.6 KiB
C++
81 lines
1.6 KiB
C++
/*
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef TEAM_DEBUG_MODEL_H
|
|
#define TEAM_DEBUG_MODEL_H
|
|
|
|
#include "Team.h"
|
|
|
|
|
|
// team debug model event types
|
|
//enum {
|
|
// TEAM_EVENT_THREAD_ADDED
|
|
//};
|
|
|
|
|
|
class Architecture;
|
|
class DebuggerInterface;
|
|
|
|
|
|
class TeamDebugModel {
|
|
public:
|
|
class Event;
|
|
class Listener;
|
|
|
|
public:
|
|
TeamDebugModel(Team* team,
|
|
DebuggerInterface* debuggerInterface,
|
|
Architecture* architecture);
|
|
~TeamDebugModel();
|
|
|
|
status_t Init();
|
|
|
|
bool Lock() { return fTeam->Lock(); }
|
|
void Unlock() { fTeam->Unlock(); }
|
|
|
|
Team* GetTeam() const { return fTeam; }
|
|
DebuggerInterface* GetDebuggerInterface() const
|
|
{ return fDebuggerInterface; }
|
|
Architecture* GetArchitecture() const
|
|
{ return fArchitecture; }
|
|
|
|
void AddListener(Listener* listener);
|
|
void RemoveListener(Listener* listener);
|
|
|
|
private:
|
|
typedef DoublyLinkedList<Listener> ListenerList;
|
|
|
|
private:
|
|
Team* fTeam;
|
|
DebuggerInterface* fDebuggerInterface;
|
|
Architecture* fArchitecture;
|
|
ListenerList fListeners;
|
|
};
|
|
|
|
|
|
class TeamDebugModel::Event {
|
|
public:
|
|
Event(uint32 type, TeamDebugModel* model);
|
|
|
|
uint32 EventType() const { return fEventType; }
|
|
TeamDebugModel* Model() const { return fModel; }
|
|
|
|
protected:
|
|
uint32 fEventType;
|
|
TeamDebugModel* fModel;
|
|
};
|
|
|
|
|
|
|
|
class TeamDebugModel::Listener
|
|
: public DoublyLinkedListLinkImpl<TeamDebugModel::Listener> {
|
|
public:
|
|
virtual ~Listener();
|
|
|
|
// virtual void ThreadAdded(const Team::ThreadEvent& event);
|
|
};
|
|
|
|
|
|
#endif // TEAM_DEBUG_MODEL_H
|