UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Attributes | List of all members
dcf::UnnamedSem Class Reference

#include <unnamed_sem.hpp>

Inheritance diagram for dcf::UnnamedSem:
dcf::Sem

Public Member Functions

 UnnamedSem (int res_num)
 
virtual ~UnnamedSem ()
 
bool ready () const
 
virtual dcf::error_t allocate (int rn=1)
 
virtual dcf::error_t release (int rn=1)
 
virtual dcf::error_t available (int &rn) const
 
- Public Member Functions inherited from dcf::Sem
 Sem (int)
 
virtual ~Sem ()
 
dcf::error_t operator-- ()
 
dcf::error_t operator++ ()
 

Protected Attributes

sem_t m_sem
 
bool m_is_ready
 

Detailed Description

POSIX unnamed semaphore

Constructor & Destructor Documentation

dcf::UnnamedSem::UnnamedSem ( int  res_num)
Constructor with number of resources provided.

By default semaphore is unlocked for all its resources.

virtual dcf::UnnamedSem::~UnnamedSem ( )
virtual

Destructs object.

Member Function Documentation

virtual dcf::error_t dcf::UnnamedSem::allocate ( int  rn = 1)
virtual

Allocates provided number of resources or waits if all resources are allocated.

Implements dcf::Sem.

virtual dcf::error_t dcf::UnnamedSem::available ( int &  rn) const
virtual

Gets number of free resources.

Implements dcf::Sem.

bool dcf::UnnamedSem::ready ( ) const
inline

Is semaphore ready.

virtual dcf::error_t dcf::UnnamedSem::release ( int  rn = 1)
virtual

Releases provided number of resources.

Implements dcf::Sem.

Member Data Documentation

sem_t dcf::UnnamedSem::m_sem
mutableprotected

< Unnamed semaphore reference. Is semaphore ready.


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