CollectionMaster::CollectVectorSequence Class Reference

#include <CollectionMaster.h>

List of all members.

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< CollectVectorInstance * > data
ResizeArray< int > queue
ResizeArray< Latticelatqueue
int blocked


Detailed Description

Definition at line 241 of file CollectionMaster.h.


Constructor & Destructor Documentation

CollectionMaster::CollectVectorSequence::CollectVectorSequence (  )  [inline]

Definition at line 291 of file CollectionMaster.h.

00291 : blocked(0) { ; }


Member Function Documentation

void CollectionMaster::CollectVectorSequence::block (  )  [inline]

Definition at line 289 of file CollectionMaster.h.

Referenced by CollectionMaster::blockPositions().

00289 { blocked = 1; }

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

Definition at line 264 of file CollectionMaster.h.

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

00264                                             {
00265       queue.add(seq);
00266       latqueue.add(lattice);
00267     }

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

Definition at line 269 of file CollectionMaster.h.

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

00270     {
00271       CollectVectorInstance *o = 0;
00272       if ( queue.size() && ! blocked )
00273       {
00274         int seq = queue[0];
00275         CollectVectorInstance **c = data.begin();
00276         CollectVectorInstance **c_e = data.end();
00277         for( ; c != c_e && (*c)->seq != seq; ++c );
00278         if ( c != c_e && (*c)->ready() )
00279         {
00280           o = *c;
00281           o->lattice = latqueue[0];
00282           queue.del(0,1);
00283           latqueue.del(0,1);
00284         }
00285       }
00286       return o;
00287     }

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

Definition at line 245 of file CollectionMaster.h.

References CollectVectorMsg::seq.

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

00246     {
00247       int seq = msg->seq;
00248       CollectVectorInstance **c = data.begin();
00249       CollectVectorInstance **c_e = data.end();
00250       for( ; c != c_e && (*c)->seq != seq; ++c );
00251       if ( c == c_e )
00252       {
00253         c = data.begin();
00254         for( ; c != c_e && (*c)->notfree(); ++c );
00255         if ( c == c_e ) {
00256           data.add(new CollectVectorInstance(seq));
00257           c = data.end() - 1;
00258         }
00259         (*c)->reset(seq);
00260       }
00261       (*c)->append(msg, max_index);
00262     }

void CollectionMaster::CollectVectorSequence::unblock (  )  [inline]

Definition at line 290 of file CollectionMaster.h.

Referenced by CollectionMaster::unblockPositions().

00290 { blocked = 0; }


Member Data Documentation

int CollectionMaster::CollectVectorSequence::blocked

Definition at line 296 of file CollectionMaster.h.

ResizeArray<CollectVectorInstance*> CollectionMaster::CollectVectorSequence::data

Definition at line 293 of file CollectionMaster.h.

ResizeArray<Lattice> CollectionMaster::CollectVectorSequence::latqueue

Definition at line 295 of file CollectionMaster.h.

ResizeArray<int> CollectionMaster::CollectVectorSequence::queue

Definition at line 294 of file CollectionMaster.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 25 01:17:16 2017 for NAMD by  doxygen 1.4.7