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

RIPCQueue Class Reference

#include <RIPCQueue.h>

Inheritance diagram for RIPCQueue:

RIPCPrimitive 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

void get (RIPCObject &objDesc)
void * get ()
bool get (RIPCObject &objDesc, unsigned timeout)
void * get (unsigned timeout)
virtual void priorityGet (int rank, RIPCObject &objDesc)=0
void * priorityGet (int rank)
virtual bool priorityGet (int rank, RIPCObject &objDesc, unsigned timeout)=0
void * priorityGet (int rank, unsigned timeout)
virtual void put (RIPCObject const &objDesc)=0
virtual void put (void const *obj, size_t objSize)=0
virtual void broadcast (RIPCObject const &objDesc)=0
virtual void broadcast (void const *obj, size_t objSize)=0
RIPCPrimitiveType getType ()
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

FIFO queue primitive. This primitive allows to pass data between consumer and producer. Elements are fetched by consumer in First-In-First-Out order. It is possible to pass objects of any type in the queue. Length of message queue is unlimited.
If more than one consumer tries to get element from the queue, thie requests will be satisfied in FIFO order.

Semantic of methods inherited from RIPCPrimitive:

waitFor
Wait until queue becomes not empty. If queue contains some elements then method immediatly returns. This method doesn't change the state of the queue.
reset
Removes all elements from the queue


Member Enumeration Documentation

enum RIPCPrimitive::RIPCPrimitiveType [inherited]
 

Primitive types


Member Function Documentation

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

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, inherited]
 

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 RIPCQueue::broadcast void const *  obj,
size_t  objSize
[pure virtual]
 

Broadcast message to all sessions currently connected to the queue. The message will no be deleted from the queue until all session read this

Parameters:
obj any not-null serializable object
objSize positive object size

virtual void RIPCQueue::broadcast RIPCObject const &  objDesc  )  [pure virtual]
 

Broadcast message to all sessions currently connected to the queue. The message will no be deleted from the queue until all session read this

Parameters:
objDesc object descriptor of broadcasted object

virtual void RIPCPrimitive::close  )  [pure virtual, inherited]
 

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, inherited]
 

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.

void* RIPCQueue::get unsigned  timeout  )  [inline]
 

Get element from the queue with timeout. If queue is empty this method waits until somebody else put element in the queue.
Element is created by means of allocate() method and is byte-to-byte copy of element placed in the queue (no conversions are done). It is responsibility of programmer to deallocate it.

Parameters:
timeout timeout in milliseconds
Returns:
received element or NULL if timeout is expired before any element was placed in the queue.

bool RIPCQueue::get RIPCObject &  objDesc,
unsigned  timeout
[inline]
 

Get element from the queue with timeout. If queue is empty this method waits until somebody else put element in the queue.
Element is created by means of allocate() method and is byte-to-byte copy of element placed in the queue (no conversions are done). It is responsibility of programmer to deallocate it.

Parameters:
objDesc object descriptor for retrieved element
timeout timeout in milliseconds
Returns:
true if succeed, false if timeout expired

void* RIPCQueue::get  )  [inline]
 

Get element from the queue. If queue is empty this method waits until somebody else put element in the queue.
Element is created by means of allocate() method and is byte-to-byte copy of element placed in the queue (no conversions are done). It is responsibility of programmer to deallocate it.

Returns:
received element

void RIPCQueue::get RIPCObject &  objDesc  )  [inline]
 

Get element from the queue. If queue is empty this method waits until somebody else put element in the queue.
If data field of object descrtiptor is not null, then it is assumed that buffer was specified by programmer. In this case size field of object descriptor specifies size of the buffer. If it is smaller than size of the fetched object, then RIPCInvalidParameterException will bee thrown. Size of the fetched object is than assigned to size field of the object descriptor.
If data field was not specified (is null), then buffer is allocated by means of allocate() methodk. It is responsibility of programmer to deallocate it (using deallocate method).

Parameters:
objDesc object descritor for retrieved element

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

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

RIPCPrimitiveType RIPCQueue::getType  )  [inline, virtual]
 

Get RIPC primitive type

Returns:
one of the constants from RIPCPrimitiveType enum

Implements RIPCPrimitive.

char const* RIPCPrimitive::getTypeName  )  [inherited]
 

Get RIPC primitive type name

Returns:
name of primitive type

void* RIPCQueue::priorityGet int  rank,
unsigned  timeout
[inline]
 

Get element from the queue with timeout. If queue is empty this method waits until somebody else put element in the queue.
Element is created by means of allocate() method and is byte-to-byte copy of element placed in the queue (no conversions are done). It is responsibility of programmer to deallocate it.

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 timeout in milliseconds
Returns:
received element or NULL if timeout is expired before any element was placed in the queue.

virtual bool RIPCQueue::priorityGet int  rank,
RIPCObject &  objDesc,
unsigned  timeout
[pure virtual]
 

Get element from the queue with timeout. If queue is empty this method waits until somebody else put element in the queue.
Element is created by means of allocate() method and is byte-to-byte copy of element placed in the queue (no conversions are done). It is responsibility of programmer to deallocate it.

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.
objDesc object descriptor for retrieved element
timeout timeout in milliseconds
Returns:
true if succeed, false if timeout expired

void* RIPCQueue::priorityGet int  rank  )  [inline]
 

Get element from the queue. If queue is empty this method waits until somebody else put element in the queue.
Element is created by means of allocate() method and is byte-to-byte copy of element placed in the queue (no conversions are done). It is responsibility of programmer to deallocate it.

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.
Returns:
received element

virtual void RIPCQueue::priorityGet int  rank,
RIPCObject &  objDesc
[pure virtual]
 

Get element from the queue. If queue is empty this method waits until somebody else put element in the queue.
If data field of object descrtiptor is not null, then it is assumed that buffer was specified by programmer. In this case size field of object descriptor specifies size of the buffer. If it is smaller than size of the fetched object, then RIPCInvalidParameterException will bee thrown. Size of the fetched object is than assigned to size field of the object descriptor.
If data field was not specified (is null), then buffer is allocated by means of allocate() methodk. It is responsibility of programmer to deallocate it (using deallocate method).

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.
objDesc object descritor for retrieved element

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

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, inherited]
 

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 RIPCQueue::put void const *  obj,
size_t  objSize
[pure virtual]
 

Put element at the end of the queue.

Parameters:
obj any not-null object
objSize positive object size

virtual void RIPCQueue::put RIPCObject const &  objDesc  )  [pure virtual]
 

Put element at the end of the queue.

Parameters:
objDesc object descriptor of enqueued object

virtual void RIPCPrimitive::reset  )  [pure virtual, inherited]
 

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, inherited]
 

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, inherited]
 

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