BroadcastClient Class Reference

#include <BroadcastClient.h>

Inheritance diagram for BroadcastClient:

SimpleBroadcastObject< T > List of all members.

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 BroadcastMgr::Object(), BroadcastMgr::subscribe(), suspended, and waitForTag.

00015                                        {
00016   this->id = id;
00017   BroadcastMgr::Object()->subscribe(*this);
00018   waitForTag = -1;
00019   suspended = 0;
00020 }

BroadcastClient::~BroadcastClient (  ) 

Definition at line 22 of file BroadcastClient.C.

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

00022                                   {
00023   BroadcastMgr::Object()->unsubscribe(*this);
00024 }


Member Function Documentation

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

Definition at line 27 of file BroadcastClient.C.

References DebugM, suspended, thread, and waitForTag.

00027                                           {
00028   DebugM(1, "awaken() client id = " << id << " tag = " << tag << "\n");
00029   if (suspended && theid == this->id && tag == waitForTag) {
00030     CthAwaken(thread);
00031     suspended = 0; waitForTag = -1;
00032   }
00033 }

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().

00036                                    {
00037   DebugM(1, "suspending() client id = " << id << " tag = " << tag << "\n");
00038   suspended = 1;
00039   waitForTag = tag;
00040   thread = CthSelf();
00041   CthSuspend();
00042 }


Member Data Documentation

int BroadcastClient::id

Definition at line 14 of file BroadcastClient.h.

Referenced by BroadcastMgr::getbuf(), BroadcastMgr::send(), BroadcastMgr::subscribe(), and BroadcastMgr::unsubscribe().

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:
Generated on Thu Nov 23 01:17:16 2017 for NAMD by  doxygen 1.4.7