HDK
 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)
 
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
 
UT_NetSocketPtr myToSelf
 
bool myError
 
int myBarrierValue
 
UT_StringHolder myTrackerAddr
 
int myTrackerPort
 
UT_StringHolder myJobName
 

Detailed Description

UT_NetBarrier

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 637 of file UT_NetMessage.h.

Constructor & Destructor Documentation

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

Member Function Documentation

void UT_NetBarrier::blockUntilComplete ( )
protected

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)
protected

Returns true until the barrier has been resolved or error occurs

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

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
protected

Definition at line 672 of file UT_NetMessage.h.

bool UT_NetBarrier::myError
protected

Definition at line 670 of file UT_NetMessage.h.

UT_StringHolder UT_NetBarrier::myJobName
protected

Definition at line 676 of file UT_NetMessage.h.

UT_NetMessagePump UT_NetBarrier::myPump
protected

Definition at line 668 of file UT_NetMessage.h.

UT_NetSocketPtr UT_NetBarrier::myToSelf
protected

Definition at line 669 of file UT_NetMessage.h.

UT_StringHolder UT_NetBarrier::myTrackerAddr
protected

Definition at line 674 of file UT_NetMessage.h.

int UT_NetBarrier::myTrackerPort
protected

Definition at line 675 of file UT_NetMessage.h.


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