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::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:80
static BroadcastMgr * Object()
Definition: BroadcastMgr.h:95

◆ ~BroadcastClient()

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:92
static BroadcastMgr * Object()
Definition: BroadcastMgr.h:95

Member Function Documentation

◆ awaken()

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

Definition at line 27 of file BroadcastClient.C.

References DebugM, suspended, thread, and waitForTag.

Referenced by BroadcastMgr::recvBroadcast().

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:75

◆ suspendFor()

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:75

Member Data Documentation

◆ id

int BroadcastClient::id

◆ suspended

int BroadcastClient::suspended
protected

Definition at line 22 of file BroadcastClient.h.

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

◆ thread

CthThread BroadcastClient::thread
protected

Definition at line 24 of file BroadcastClient.h.

Referenced by awaken(), and suspendFor().

◆ waitForTag

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: