Add model classes for representing semaphore information.
This commit is contained in:
parent
adf25fc437
commit
dcbc00c3cf
@ -146,6 +146,7 @@ Application Debugger :
|
||||
Image.cpp
|
||||
ImageInfo.cpp
|
||||
ReturnValueInfo.cpp
|
||||
SemaphoreInfo.cpp
|
||||
SourceCode.cpp
|
||||
StackFrame.cpp
|
||||
StackFrameValues.cpp
|
||||
|
53
src/apps/debugger/model/SemaphoreInfo.cpp
Normal file
53
src/apps/debugger/model/SemaphoreInfo.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2013, Rene Gollent, rene@gollent.com.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include "SemaphoreInfo.h"
|
||||
|
||||
|
||||
SemaphoreInfo::SemaphoreInfo()
|
||||
:
|
||||
fTeam(-1),
|
||||
fSemaphore(-1),
|
||||
fName(),
|
||||
fCount(0),
|
||||
fLatestHolder(-1)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SemaphoreInfo::SemaphoreInfo(const SemaphoreInfo &other)
|
||||
:
|
||||
fTeam(other.fTeam),
|
||||
fSemaphore(other.fSemaphore),
|
||||
fName(other.fName),
|
||||
fCount(other.fCount),
|
||||
fLatestHolder(other.fLatestHolder)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SemaphoreInfo::SemaphoreInfo(team_id team, sem_id semaphore,
|
||||
const BString& name, int32 count, thread_id latestHolder)
|
||||
:
|
||||
fTeam(team),
|
||||
fSemaphore(semaphore),
|
||||
fName(name),
|
||||
fCount(count),
|
||||
fLatestHolder(latestHolder)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SemaphoreInfo::SetTo(team_id team, sem_id semaphore, const BString& name,
|
||||
int32 count, thread_id latestHolder)
|
||||
{
|
||||
fTeam = team;
|
||||
fSemaphore = semaphore;
|
||||
fName = name;
|
||||
fCount = count;
|
||||
fLatestHolder = latestHolder;
|
||||
}
|
42
src/apps/debugger/model/SemaphoreInfo.h
Normal file
42
src/apps/debugger/model/SemaphoreInfo.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2013, Rene Gollent, rene@gollent.com.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef SEMAPHORE_INFO_H
|
||||
#define SEMAPHORE_INFO_H
|
||||
|
||||
#include <OS.h>
|
||||
#include <String.h>
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
|
||||
class SemaphoreInfo {
|
||||
public:
|
||||
SemaphoreInfo();
|
||||
SemaphoreInfo(const SemaphoreInfo& other);
|
||||
SemaphoreInfo(team_id team, sem_id semaphore,
|
||||
const BString& name, int32 count,
|
||||
thread_id latestHolder);
|
||||
|
||||
void SetTo(team_id team, sem_id semaphore,
|
||||
const BString& name, int32 count,
|
||||
thread_id latestHolder);
|
||||
|
||||
team_id TeamID() const { return fTeam; }
|
||||
area_id SemID() const { return fSemaphore; }
|
||||
const BString& Name() const { return fName; }
|
||||
|
||||
int32 Count() const { return fCount; }
|
||||
thread_id LatestHolder() const
|
||||
{ return fLatestHolder; }
|
||||
private:
|
||||
team_id fTeam;
|
||||
sem_id fSemaphore;
|
||||
BString fName;
|
||||
int32 fCount;
|
||||
thread_id fLatestHolder;
|
||||
};
|
||||
|
||||
|
||||
#endif // AREA_INFO_H
|
Loading…
Reference in New Issue
Block a user