Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

semaphore Class Reference

class supports semaphores More...

#include <primitives.h>

List of all members.

Public Types

typedef HANDLE _HANDLE_

Public Member Functions

 semaphore (size_t initial_count=1, size_t max_count=1)
 constructor
 ~semaphore ()
 destructor
bool release (size_t count=1) const
 releases semaphore NB!!! can be used in the const member function
size_t wait (size_t timeout=INFINITE) const
 waitd for signal state NB!!! can be used in the const member function

Private Member Functions

 semaphore (const semaphore &x)
 copy constructor
semaphoreoperator= (const semaphore &x)
 assign operator

Private Attributes

HANDLE _handle
 keep semaphore handle


Detailed Description

class supports semaphores

Definition at line 205 of file primitives.h.


Member Typedef Documentation

typedef HANDLE semaphore::_HANDLE_

Definition at line 216 of file primitives.h.


Constructor & Destructor Documentation

semaphore::semaphore ( const semaphore x  )  [private]

copy constructor

prevents the copying of objects

semaphore::semaphore ( size_t  initial_count = 1,
size_t  max_count = 1 
)

constructor

Parameters:
initial_count  initial locks
max_count  max locks

Definition at line 231 of file primitives.cpp.

References _handle.

semaphore::~semaphore (  ) 

destructor

Definition at line 250 of file primitives.cpp.

References _handle.


Member Function Documentation

semaphore& semaphore::operator= ( const semaphore x  )  [private]

assign operator

bool semaphore::release ( size_t  count = 1  )  const

releases semaphore NB!!! can be used in the const member function

Parameters:
count  unlock counts

Definition at line 265 of file primitives.cpp.

References _handle.

Referenced by semaphore_keeper::~semaphore_keeper().

size_t semaphore::wait ( size_t  timeout = INFINITE  )  const

waitd for signal state NB!!! can be used in the const member function

Parameters:
timeout  timeout in milliseconds

Definition at line 297 of file primitives.cpp.

References _handle.

Referenced by semaphore_keeper::semaphore_keeper().


Member Data Documentation

HANDLE semaphore::_handle [mutable, private]

keep semaphore handle

Definition at line 244 of file primitives.h.

Referenced by release(), semaphore(), wait(), and ~semaphore().


The documentation for this class was generated from the following files:


© Copyright Terimber 2003-.