Flair
Framework Libre Air
|
Class defining a semaphore. More...
#include <Semaphore.h>
Public Types | |
enum | Type { anonymous, named } |
Public Types inherited from flair::core::Object | |
enum | color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 } |
Public Member Functions | |
Semaphore (const Object *parent, uint32_t initialValue, std::string name="", Type type=Type::anonymous) | |
Constructor. More... | |
~Semaphore () | |
Destructor. More... | |
bool | TryGetSemaphore () const |
TryGetSemaphore. More... | |
bool | GetSemaphore (Time timeout=TIME_INFINITE) const |
GetSemaphore. More... | |
bool | ReleaseSemaphore (void) const |
ReleaseSemaphore. More... | |
Public Member Functions inherited from flair::core::Object | |
Object (const Object *parent=NULL, std::string name="", std::string type="") | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
std::string | ObjectName (void) const |
Name. More... | |
std::string | ObjectType (void) const |
Type. More... | |
const Object * | Parent (void) const |
Parent. More... | |
std::vector< const Object * > * | TypeChilds (void) const |
Childs of the same type. More... | |
std::vector< const Object * > * | Childs (void) const |
Childs. More... | |
void | Information (const char *function, int line, const char *format,...) const |
Formatted information. More... | |
void | Warning (const char *function, const char *format,...) const |
Formatted warning. More... | |
void | Error (const char *function, const char *format,...) const |
Formatted error. More... | |
bool | ErrorOccured (bool recursive=true) const |
Has an errror occured? More... | |
Class defining a semaphore.
flair::core::Semaphore::Semaphore | ( | const Object * | parent, |
uint32_t | initialValue, | ||
std::string | name = "" , |
||
Type | type = Type::anonymous |
||
) |
Constructor.
Construct a semaphore.
parent | parent |
name | name |
flair::core::Semaphore::~Semaphore | ( | ) |
Destructor.
bool flair::core::Semaphore::TryGetSemaphore | ( | ) | const |
TryGetSemaphore.
Lock the semaphore. If not possible immediately returns false
bool flair::core::Semaphore::GetSemaphore | ( | Time | timeout = TIME_INFINITE | ) | const |
GetSemaphore.
Lock the semaphore.
timeout | The timeout, in nanoseconds. |
bool flair::core::Semaphore::ReleaseSemaphore | ( | void | ) | const |
ReleaseSemaphore.
Unlock the semaphore.