NAMD
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
BroadcastClient Class Reference

#include <BroadcastClient.h>

Inheritance diagram for BroadcastClient:
SimpleBroadcastObject< T > SimpleBroadcastObject< BigReal > SimpleBroadcastObject< int > SimpleBroadcastObject< Tensor > SimpleBroadcastObject< Vector >

Public Member Functions

 BroadcastClient (int id)
 
 ~BroadcastClient ()
 
void awaken (int id, int tag)
 

Public Attributes

int id
 

Protected Member Functions

void suspendFor (int tag)
 

Protected Attributes

int suspended
 
int waitForTag
 
CthThread thread
 

Detailed Description

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 12 of file BroadcastClient.h.

Constructor & Destructor Documentation

BroadcastClient::BroadcastClient ( int  id)

Definition at line 15 of file BroadcastClient.C.

References id, BroadcastMgr::Object(), BroadcastMgr::subscribe(), suspended, and waitForTag.

15  {
16  this->id = id;
18  waitForTag = -1;
19  suspended = 0;
20 }
void subscribe(BroadcastClient &bc)
Definition: BroadcastMgr.C:60
static BroadcastMgr * Object()
Definition: BroadcastMgr.h:96
BroadcastClient::~BroadcastClient ( )

Definition at line 22 of file BroadcastClient.C.

References BroadcastMgr::Object(), and BroadcastMgr::unsubscribe().

22  {
24 }
void unsubscribe(BroadcastClient &bc)
Definition: BroadcastMgr.C:72
static BroadcastMgr * Object()
Definition: BroadcastMgr.h:96

Member Function Documentation

void BroadcastClient::awaken ( int  id,
int  tag 
)

Definition at line 27 of file BroadcastClient.C.

References DebugM, suspended, thread, and waitForTag.

27  {
28  DebugM(1, "awaken() client id = " << id << " tag = " << tag << "\n");
29  if (suspended && theid == this->id && tag == waitForTag) {
30  CthAwaken(thread);
31  suspended = 0; waitForTag = -1;
32  }
33 }
#define DebugM(x, y)
Definition: Debug.h:59
void BroadcastClient::suspendFor ( int  tag)
protected

Definition at line 36 of file BroadcastClient.C.

References DebugM, suspended, thread, and waitForTag.

Referenced by SimpleBroadcastObject< Tensor >::get().

36  {
37  DebugM(1, "suspending() client id = " << id << " tag = " << tag << "\n");
38  suspended = 1;
39  waitForTag = tag;
40  thread = CthSelf();
41  CthSuspend();
42 }
#define DebugM(x, y)
Definition: Debug.h:59

Member Data Documentation

int BroadcastClient::id
int BroadcastClient::suspended
protected

Definition at line 22 of file BroadcastClient.h.

Referenced by awaken(), BroadcastClient(), and suspendFor().

CthThread BroadcastClient::thread
protected

Definition at line 24 of file BroadcastClient.h.

Referenced by awaken(), and suspendFor().

int BroadcastClient::waitForTag
protected

Definition at line 23 of file BroadcastClient.h.

Referenced by awaken(), BroadcastClient(), and suspendFor().


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