NAME
Oorb::Queue - internal queue management class for the oorb library
SYNOPSIS
-loorb $(ORBLIBS)
#include "oorb.h"
namespace Oorb
class Queue
DESCRIPTION
This page describes the
Queue class, which is used within the
Oorb(3) library
to manage MT-safe FIFO queues of
Oorb::OrbPacket(3)'s. This class is a wrapper
around the Antelope
pmtmanagedfifo(3) utility.
CONSTRUCTORS
-
Queue( std::string queueName )
The constructor for the Queue class takes a single argument, which is
the name of the queue within the enclosing program. This queueName
is used by other components of the library to look up Queue objects
as necessary.
METHODS
-
void setProducer( std::string producerName );
The setProducer method registers with the Queue object the string name of a FIFO
producer, usually the name of an Oorb::Task(3), via the underlying pmtmanagedfifo_set_producer(3)
function.
-
void setConsumer( std::string consumerName, int maxQueue );
The setConsumer method registers with the Queue object the string name of a FIFO
consumer, usually the name of an Oorb::Task(3), via the underlying pmtmanagedfifo_set_consumer(3)
function. The maxQueue argument specifies the number of backed-up packets
in the FIFO that are allowed before further push calls are blocked. If
maxQueue is set to 0, the Queue is allowed to grow
indefinitely.
-
void push( std::shared_ptr<OrbPacket>& op );
The push method adds the given Oorb::OrbPacket(3) op to the
end of the Queue.
-
void push_eof( std::string producerName );
The push_eof method pushes an end-of-file marker onto the Queue.
If producerName is non-null, the underlying
pmtmanagedfifo_push_eof(3) routine waits until all producers have
requested an EOF before pushing it onto the Queue.
-
std::shared_ptr<OrbPacket> pop( std::string consumerName );
The pop method retrieves a copy of the next Oorb::OrbPacket(3)
off the Queue in the name of consumerName.
-
int getQueueCount( std::string consumerName );
The getQueueCount method returns the count of objects on the Queue
remaining for the named consumer.
LIBRARY
-loorb $(ORBLIBS)
ATTRIBUTES
MT-Safe
SEE ALSO
Oorb(3), Oorb::OrbPacket(3), pmtmanagedfifo(3)
AUTHOR
Kent Lindquist