EventSemaphore.hpp
#if !defined(__EVENTSEMAPHORE_HPP)
#define __EVENTSEMAPHORE_HPP
/*
CoreLinux++
Copyright (C) 1999,2000 CoreLinux Consortium
The CoreLinux++ Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The CoreLinux++ Library Library is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if !defined(__COMMON_HPP)
#include <Common.hpp>
#endif
#if !defined(__SEMAPHORE_HPP)
#include <Semaphore.hpp>
#endif
namespace corelinux
{
DECLARE_CLASS( EventSemaphore );
class EventSemaphore : public Semaphore
{
public:
//
// Constructors and destructors
//
EventSemaphore
(
SemaphoreGroupPtr aGroup,
SemaphoreIdentifierRef aIdentifier,
Counter aLimit,
bool aRecursionFlag = true,
bool aBalkingFlag = false
) throw ( NullPointerException );
virtual ~EventSemaphore( void );
//
// Accessors
//
virtual bool isLocked( void ) ;
//
// Mutators
//
SemaphoreOperationStatus post( void )
throw( SemaphoreException );
virtual SemaphoreOperationStatus lockWithWait( void )
throw( SemaphoreException );
virtual SemaphoreOperationStatus lockWithNoWait( void )
throw( SemaphoreException );
// virtual SemaphoreOperationStatus lockWithTimeOut( Timer )
// throw(SemaphoreException) = 0;
virtual SemaphoreOperationStatus release( void )
throw( SemaphoreException );
virtual void setLimit ( Counter aLimit ) throw ( SemaphoreException );
virtual Counter getLimit ( void ) const;
protected:
//
// Constructors
//
EventSemaphore( void ) throw( Assertion );
EventSemaphore( EventSemaphoreCref ) throw( Assertion );
//
// Operator overloads
//
EventSemaphoreRef operator=( EventSemaphoreCref )
throw( Assertion );
private:
Counter theNumListeners;
Counter theMaxListeners;
};
}
#endif // if !defined(__EVENTSEMAPHORE_HPP)
/*
Common rcs information do not modify
$Author: dulimart $
$Revision: 1.7 $
$Date: 2000/11/15 22:32:06 $
$Locker: $
*/
corelinux::EventSemaphore::EventSemaphore
EventSemaphore(void)
Default constructor throws assert.
Definition: EventSemaphore.cpp:41
corelinux::EventSemaphore::isLocked
virtual bool isLocked(void)
Check if semaphore instance is locked.
Definition: EventSemaphore.cpp:93
corelinux::EventSemaphore::~EventSemaphore
virtual ~EventSemaphore(void)
Virtual Destructor.
Definition: EventSemaphore.cpp:84
corelinux::EventSemaphore
EventSemaphore implements a way to queue its caller until a certain event takes place.
Definition: EventSemaphore.hpp:41
corelinux::EventSemaphore::getLimit
virtual Counter getLimit(void) const
Get the maximum number of listeners of this semaphore.
Definition: EventSemaphore.cpp:292
corelinux::SemaphoreOperationStatus
SemaphoreOperationStatus
Semaphore method return enumeration.
Definition: AbstractSemaphore.hpp:39
corelinux::EventSemaphore::post
SemaphoreOperationStatus post(void)
Indicate owner commitment to trigger the event after a finite amount of time.
Definition: EventSemaphore.cpp:102
corelinux
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
corelinux::EventSemaphore::lockWithWait
virtual SemaphoreOperationStatus lockWithWait(void)
Wait for the event associated with this semaphore to take place.
Definition: EventSemaphore.cpp:134
corelinux::NullPointerException
NullPointerException is the base exception type for NullPointer.
Definition: NullPointerException.hpp:40
corelinux::ScalarIdentifier
ScalarIdentifier provides a templated interface for declaring CoreLinux Identifiers for simple scalar...
Definition: ScalarIdentifiers.hpp:37
corelinux::SemaphoreException
SemaphoreException is the base exception type for Semaphore.
Definition: SemaphoreException.hpp:39
corelinux::Semaphore
A Semaphore supports the protocol that processes and/or threads agree to follow for the purpose of co...
Definition: Semaphore.hpp:61
corelinux::EventSemaphore::release
virtual SemaphoreOperationStatus release(void)
Request the semaphore but timeout if not available.
Definition: EventSemaphore.cpp:251
corelinux::Assertion
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
corelinux::EventSemaphore::operator=
EventSemaphoreRef operator=(EventSemaphoreCref)
Assignment operator throws assertion.
corelinux::EventSemaphore::lockWithNoWait
virtual SemaphoreOperationStatus lockWithNoWait(void)
Check if the associated event has taken place.
Definition: EventSemaphore.cpp:193
corelinux::EventSemaphore::setLimit
virtual void setLimit(Counter aLimit)
Set the maximum number of listeners allowed on this semaphore.
Definition: EventSemaphore.cpp:270
corelinux::SemaphoreGroup
A SemaphoreGroup is an extension to the Linux semaphore set.
Definition: SemaphoreGroup.hpp:62

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium