Main Page | Class Hierarchy | Class List | File List | Class Members

RIPCPrimitive Class Reference

#include <RIPCPrimitive.h>

Inheritance diagram for RIPCPrimitive:

RIPCBarrier RIPCEvent RIPCLock RIPCMutex RIPCQueue RIPCSemaphore RIPCSharedMemory List of all members.

Public Types

enum  RIPCPrimitiveType {
  RIPC_MUTEX, RIPC_EVENT, RIPC_SEMAPHORE, RIPC_BARRIER,
  RIPC_LOCK, RIPC_SHARED_MEMORY, RIPC_QUEUE
}
enum  RIPCRanks { DEFAULT_RANK = 0 }

Public Member Functions

virtual RIPCPrimitiveType getType ()=0
char const * getTypeName ()
virtual char const * getName ()=0
virtual bool alreadyExists ()=0
void waitFor ()
bool waitFor (unsigned timeout)
virtual void priorityWait (int rank)=0
virtual bool priorityWait (int rank, unsigned timeout)=0
virtual void reset ()=0
virtual void close ()=0
virtual void * allocate (size_t size)
virtual void deallocate (void *obj, size_t size=0)

Static Public Member Functions

void deallocator (RIPCObject const &objDesc)

Detailed Description

Base class for all synchronizatin primitives. Semantic of waitFor and reset methods for particular primitives explained in the descripotion of these proimitives


Member Enumeration Documentation

enum RIPCPrimitive::RIPCPrimitiveType
 

Primitive types


Member Function Documentation

virtual void* RIPCPrimitive::allocate size_t  size  )  [virtual]
 

Method for allocation memory for container elements (currently queue and shared memory). This method can be overriden by derived class* to provide custom allocation policy.

virtual bool RIPCPrimitive::alreadyExists  )  [pure virtual]
 

Primitive returned by createXXX method already exists This method should be call immediatly after createXXX to check if new primitive was created or existed one was returned.

Returns:
true if createXXX method doesn't create new primitive

virtual void RIPCPrimitive::close  )  [pure virtual]
 

Close primitive. This method decrease access counter of the primitive and once it becomes zero, primitive is destroyed.

virtual void RIPCPrimitive::deallocate void *  obj,
size_t  size = 0
[virtual]
 

Method for deallocation memory for container elements (currently queue and shared memory). This method can be overriden by derived class to provide custom allocation policy.

virtual char const* RIPCPrimitive::getName  )  [pure virtual]
 

Get primitive name. Name of the primitive is unique with primitives of the same type (events, semaphores,...). It is possible that, for example, event and mutex has the same name.

Returns:
primitive name

virtual RIPCPrimitiveType RIPCPrimitive::getType  )  [pure virtual]
 

Get RIPC primitive type

Returns:
one of the constants from RIPCPrimitiveType enum

Implemented in RIPCEvent, RIPCLock, RIPCMutex, RIPCQueue, RIPCSemaphore, and RIPCSharedMemory.

char const* RIPCPrimitive::getTypeName  ) 
 

Get RIPC primitive type name

Returns:
name of primitive type

virtual bool RIPCPrimitive::priorityWait int  rank,
unsigned  timeout
[pure virtual]
 

Priority wait until state of primitive is switched with timeout. Requests with the lowest rank value will be satisfied first. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.

Parameters:
rank processes will be placed in wait queue in the order of increasing rank value and in the same order will be taken from the queue.
timeout operation timeout in millisoconds
Returns:
false if timeout is expired before primitive state is changed

virtual void RIPCPrimitive::priorityWait int  rank  )  [pure virtual]
 

Priority wait until state of primitive is switched. Requests with the lowest rank value will be satisfied first. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.

Parameters:
rank processes will be placed in wait queue in the order of increasing rank value and in the same order will be taken from the queue.

virtual void RIPCPrimitive::reset  )  [pure virtual]
 

Reset primitive. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.

bool RIPCPrimitive::waitFor unsigned  timeout  )  [inline]
 

Wait until state of primitive is switched with timeout. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.

Returns:
false if timeout is expired before primitive state is changed

void RIPCPrimitive::waitFor  )  [inline]
 

Wait until state of primitive is switched. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.


The documentation for this class was generated from the following file:
Generated on Wed Nov 26 14:58:19 2003 for RIPC by doxygen 1.3.5