NAMD
Public Member Functions | Public Attributes | List of all members
CollectionMaster::CollectVectorSequence Class Reference

#include <CollectionMaster.h>

Inheritance diagram for CollectionMaster::CollectVectorSequence:
CollectionMaster::CollectVectorSequenceDcdSelection

Public Member Functions

void submitData (CollectVectorMsg *msg, int max_index)
 
void enqueue (int seq, Lattice &lattice)
 
CollectVectorInstanceremoveReady (void)
 
void block ()
 
void unblock ()
 
 CollectVectorSequence ()
 

Public Attributes

ResizeArray< int > queue
 
ResizeArray< Latticelatqueue
 
int blocked
 

Detailed Description

Definition at line 272 of file CollectionMaster.h.

Constructor & Destructor Documentation

◆ CollectVectorSequence()

CollectionMaster::CollectVectorSequence::CollectVectorSequence ( )
inline

Definition at line 322 of file CollectionMaster.h.

Member Function Documentation

◆ block()

void CollectionMaster::CollectVectorSequence::block ( )
inline

Definition at line 320 of file CollectionMaster.h.

References blocked.

Referenced by CollectionMaster::blockPositions().

◆ enqueue()

void CollectionMaster::CollectVectorSequence::enqueue ( int  seq,
Lattice lattice 
)
inline

◆ removeReady()

CollectVectorInstance* CollectionMaster::CollectVectorSequence::removeReady ( void  )
inline

Definition at line 300 of file CollectionMaster.h.

References blocked, ResizeArray< Elem >::del(), latqueue, queue, and ResizeArray< Elem >::size().

Referenced by CollectionMaster::enqueueForces(), CollectionMaster::enqueuePositions(), CollectionMaster::enqueueVelocities(), CollectionMaster::receiveForces(), CollectionMaster::receivePositions(), and CollectionMaster::receiveVelocities().

301  {
302  CollectVectorInstance *o = 0;
303  if ( queue.size() && ! blocked )
304  {
305  int seq = queue[0];
306  CollectVectorInstance **c = data.begin();
307  CollectVectorInstance **c_e = data.end();
308  for( ; c != c_e && (*c)->seq != seq; ++c );
309  if ( c != c_e && (*c)->ready() )
310  {
311  o = *c;
312  o->lattice = latqueue[0];
313  queue.del(0,1);
314  latqueue.del(0,1);
315  }
316  }
317  return o;
318  }
int size(void) const
Definition: ResizeArray.h:131
void del(int index, int num=1)
Definition: ResizeArray.h:108

◆ submitData()

void CollectionMaster::CollectVectorSequence::submitData ( CollectVectorMsg msg,
int  max_index 
)
inline

Definition at line 276 of file CollectionMaster.h.

References CollectVectorMsg::seq.

Referenced by CollectionMaster::receiveForces(), CollectionMaster::receiveOutputForceReady(), CollectionMaster::receiveOutputVelReady(), CollectionMaster::receivePositions(), and CollectionMaster::receiveVelocities().

277  {
278  int seq = msg->seq;
279  CollectVectorInstance **c = data.begin();
280  CollectVectorInstance **c_e = data.end();
281  for( ; c != c_e && (*c)->seq != seq; ++c );
282  if ( c == c_e )
283  {
284  c = data.begin();
285  for( ; c != c_e && (*c)->notfree(); ++c );
286  if ( c == c_e ) {
287  data.add(new CollectVectorInstance(seq));
288  c = data.end() - 1;
289  }
290  (*c)->reset(seq);
291  }
292  (*c)->append(msg, max_index);
293  }

◆ unblock()

void CollectionMaster::CollectVectorSequence::unblock ( )
inline

Definition at line 321 of file CollectionMaster.h.

References blocked.

Referenced by CollectionMaster::unblockPositions().

Member Data Documentation

◆ blocked

int CollectionMaster::CollectVectorSequence::blocked

Definition at line 327 of file CollectionMaster.h.

Referenced by block(), removeReady(), and unblock().

◆ latqueue

ResizeArray<Lattice> CollectionMaster::CollectVectorSequence::latqueue

◆ queue

ResizeArray<int> CollectionMaster::CollectVectorSequence::queue

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