Add model classes for representing semaphore information.
This commit is contained in:
@@ -146,6 +146,7 @@ Application Debugger :
|
|||||||
Image.cpp
|
Image.cpp
|
||||||
ImageInfo.cpp
|
ImageInfo.cpp
|
||||||
ReturnValueInfo.cpp
|
ReturnValueInfo.cpp
|
||||||
|
SemaphoreInfo.cpp
|
||||||
SourceCode.cpp
|
SourceCode.cpp
|
||||||
StackFrame.cpp
|
StackFrame.cpp
|
||||||
StackFrameValues.cpp
|
StackFrameValues.cpp
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013, Rene Gollent, [email protected].
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2013, Rene Gollent, [email protected].
|
||||||
|
* 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
|
||||||
Reference in New Issue
Block a user