1/*
2 * Copyright 2013, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef SEMAPHORE_INFO_H
6#define SEMAPHORE_INFO_H
7
8#include <OS.h>
9#include <String.h>
10
11#include "Types.h"
12
13
14class SemaphoreInfo {
15public:
16								SemaphoreInfo();
17								SemaphoreInfo(const SemaphoreInfo& other);
18								SemaphoreInfo(team_id team, sem_id semaphore,
19									const BString& name, int32 count,
20									thread_id latestHolder);
21
22			void				SetTo(team_id team, sem_id semaphore,
23									const BString& name, int32 count,
24									thread_id latestHolder);
25
26			team_id				TeamID() const	{ return fTeam; }
27			area_id				SemID() const	{ return fSemaphore; }
28			const BString&		Name() const	{ return fName; }
29
30			int32				Count() const	{ return fCount; }
31			thread_id			LatestHolder() const
32												{ return fLatestHolder; }
33private:
34			team_id				fTeam;
35			sem_id				fSemaphore;
36			BString				fName;
37			int32				fCount;
38			thread_id			fLatestHolder;
39};
40
41
42#endif // AREA_INFO_H
43