All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_NetBarrier Class Reference

#include <UT_NetMessage.h>

Public Member Functions

 UT_NetBarrier (const UT_StringHolder &trackeraddr, int trackerport, const UT_StringHolder &jobname)
virtual ~UT_NetBarrier ()
void setValue (int val)
void waitValue (int val)
int incrementValue (int defaultval)

Protected Member Functions

void sendTrackerMessage (const char *msg, int value)
 Creates and posts a message for the tracker. More...
void blockUntilComplete ()
bool pumpData (int timeoutms)

Protected Attributes

UT_NetMessagePump myPump
bool myError
int myBarrierValue
UT_StringHolder myTrackerAddr
int myTrackerPort
UT_StringHolder myJobName

Detailed Description


Very similar to UT_NetExchange, using the same tracker. However, it is meant for creating producer/consumer queues where the data is transmitted OOB (ie, on shared disk resource) The producer can call setValue() to indicate how far it has completed. The consumer can invoke waitValue() to idle until the setValue is equal or greater than the waitValue.

These calls will all block until success, error, or interrupt.

Definition at line 632 of file UT_NetMessage.h.

Constructor & Destructor Documentation

UT_NetBarrier::UT_NetBarrier ( const UT_StringHolder trackeraddr,
int  trackerport,
const UT_StringHolder jobname 
virtual UT_NetBarrier::~UT_NetBarrier ( )

Member Function Documentation

void UT_NetBarrier::blockUntilComplete ( )

A simplified method for running the message pump until the system errors or is interrupted.

int UT_NetBarrier::incrementValue ( int  defaultval)

Returns current value of the barrier and then increments the barrier's value. Blocks until the tracker responds.

bool UT_NetBarrier::pumpData ( int  timeoutms)

Returns true until the barrier has been resolved or error occurs

void UT_NetBarrier::sendTrackerMessage ( const char *  msg,
int  value 

Creates and posts a message for the tracker.

void UT_NetBarrier::setValue ( int  val)

Tells the tracker to update the barrier value to the given value. Does not listen for a tracker response.

void UT_NetBarrier::waitValue ( int  val)

Requests the tracker to alert us when the given value is reached on the barrier.

Member Data Documentation

int UT_NetBarrier::myBarrierValue

Definition at line 668 of file UT_NetMessage.h.

bool UT_NetBarrier::myError

Definition at line 666 of file UT_NetMessage.h.

UT_StringHolder UT_NetBarrier::myJobName

Definition at line 672 of file UT_NetMessage.h.

UT_NetMessagePump UT_NetBarrier::myPump

Definition at line 664 of file UT_NetMessage.h.

UT_NetSocket* UT_NetBarrier::myToSelf

Definition at line 665 of file UT_NetMessage.h.

UT_StringHolder UT_NetBarrier::myTrackerAddr

Definition at line 670 of file UT_NetMessage.h.

int UT_NetBarrier::myTrackerPort

Definition at line 671 of file UT_NetMessage.h.

The documentation for this class was generated from the following file: