com::pcbsys::nirvana::client::nQueuePeekContext Class Reference

Provides a context when peeking on the queue. More...

#include <nQueuePeekContext.h>

Inherits CountableObject.

Public Member Functions

int getIndex ()
 Returns the index into the queue that the context is up to. More...
 
const std::string getSelector ()
 Retrieves the message selector (if any) set to filter events on this peek context. More...
 
int getWindowSize ()
 Retrieves the size of the window used by this queue peek context. More...
 
bool hasMore ()
 Returns a boolean indicating if there are any more events in the queue. More...
 
 nQueuePeekContext (int windowSize=0, const std::string selector="")
 Creates a queue peek context with the specified window size and message selector to filter events with. More...
 
void setHasMore (bool flag)
 Sets the flag to true if more events in the queue. More...
 
void setIndex (int idx)
 
void setWindowSize (int size)
 Sets the size of the window. More...
 

Detailed Description

Provides a context when peeking on the queue.

Useful when multiple calls are required to traverse the entire queue.

Constructor & Destructor Documentation

com::pcbsys::nirvana::client::nQueuePeekContext::nQueuePeekContext ( int  windowSize = 0,
const std::string  selector = "" 
)

Creates a queue peek context with the specified window size and message selector to filter events with.

Parameters
windowSizeNumber of events which will be delivered to the client per lookup
selectorMessage selector to apply to the events

Member Function Documentation

int com::pcbsys::nirvana::client::nQueuePeekContext::getIndex ( )

Returns the index into the queue that the context is up to.

Returns
current index
const std::string com::pcbsys::nirvana::client::nQueuePeekContext::getSelector ( )

Retrieves the message selector (if any) set to filter events on this peek context.

Returns
the selector used by this context
int com::pcbsys::nirvana::client::nQueuePeekContext::getWindowSize ( )

Retrieves the size of the window used by this queue peek context.

Returns
The size of the window
bool com::pcbsys::nirvana::client::nQueuePeekContext::hasMore ( )

Returns a boolean indicating if there are any more events in the queue.

Returns
true if more
void com::pcbsys::nirvana::client::nQueuePeekContext::setHasMore ( bool  flag)

Sets the flag to true if more events in the queue.

(Server specific).

Parameters
flagto specify whether there are more events to come
void com::pcbsys::nirvana::client::nQueuePeekContext::setIndex ( int  idx)
Parameters
idxIndex value to set
void com::pcbsys::nirvana::client::nQueuePeekContext::setWindowSize ( int  size)

Sets the size of the window.

Parameters
sizeA size greater than 0