NAMD
Public Member Functions | Friends | List of all members
Box< Owner, Data > Class Template Reference

#include <Box.h>

Public Member Functions

Data * open (void)
 
void close (Data **const t)
 
void skip (void)
 

Friends

class OwnerBox< Owner, Data >
 

Detailed Description

template<class Owner, class Data>
class Box< Owner, Data >

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

Definition at line 14 of file Box.h.

Member Function Documentation

template<class Owner, class Data>
void Box< Owner, Data >::close ( Data **const  t)
inline

Definition at line 49 of file Box.h.

Referenced by ComputeNonbondedPair::doForce(), ComputeNonbondedSelf::doForce(), ComputePatch::doWork(), ComputeHomePatch::doWork(), ComputePatchPair::doWork(), ComputePme::doWork(), ComputeLCPO::doWork(), ComputeNonbondedCUDA::finishPatch(), ComputeNonbondedCUDA::finishWork(), and ComputePme::ungridForces().

49  {
50  *t = NULL;
51  ownerBox->closeCount--;
52 #ifdef BOX_DEBUG
53  if (ownerBox->closeCount < 0) NAMD_bug("too many boxes closed");
54  if (state != OPEN) NAMD_bug("box re-closed");
55  state = CLOSED;
56 #endif
57  // Trigger callback!
58  if ( ! ownerBox->closeCount ) {
59  ownerBox->close();
60  }
61  }
void NAMD_bug(const char *err_msg)
Definition: common.C:129
template<class Owner, class Data>
Data* Box< Owner, Data >::open ( void  )
inline

Definition at line 39 of file Box.h.

Referenced by ComputeNonbondedPair::doForce(), ComputeNonbondedSelf::doForce(), ComputePatch::doWork(), ComputePatchPair::doWork(), ComputeHomePatch::doWork(), ComputePme::doWork(), ComputeLCPO::doWork(), ComputeNonbondedCUDA::finishPatch(), ComputeNonbondedCUDA::finishWork(), ComputeNonbondedCUDA::noWork(), and ComputePme::ungridForces().

39  {
40  ownerBox->openCount--;
41 #ifdef BOX_DEBUG
42  if (ownerBox->openCount < 0) NAMD_bug("too many boxes opened");
43  if (state != CLOSED) NAMD_bug("box re-opened");
44  state = OPEN;
45 #endif
46  return ownerBox->data;
47  }
void NAMD_bug(const char *err_msg)
Definition: common.C:129
template<class Owner, class Data>
void Box< Owner, Data >::skip ( void  )
inline

Definition at line 63 of file Box.h.

Referenced by ComputeNonbondedPair::noWork(), ComputeNonbondedSelf::noWork(), ComputePme::noWork(), ComputeLCPO::noWork(), and ComputeNonbondedCUDA::skip().

63  {
64  ownerBox->openCount--;
65  ownerBox->closeCount--;
66 #ifdef BOX_DEBUG
67  if (state != CLOSED) NAMD_bug("box skipped while open");
68  if (ownerBox->openCount < 0) NAMD_bug("too many boxes opened");
69  if (ownerBox->closeCount < 0) NAMD_bug("too many boxes closed");
70 #endif
71  if ( ! ownerBox->closeCount ) {
72  ownerBox->close();
73  }
74  }
void NAMD_bug(const char *err_msg)
Definition: common.C:129

Friends And Related Function Documentation

template<class Owner, class Data>
friend class OwnerBox< Owner, Data >
friend

Definition at line 16 of file Box.h.


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