Simpatico  v1.10
ClusterLink.h
1 #ifndef MCMD_CLUSTER_LINK_H
2 #define MCMD_CLUSTER_LINK_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 namespace McMd
12 {
13 
14  class Molecule;
15  class Cluster;
16 
22  struct ClusterLink
23  {
24 
25  public:
26 
30  void clear();
31 
36 
40  Molecule& molecule() const;
41 
45  ClusterLink* next() const;
46 
50  int clusterId() const;
51 
52  private:
53 
55  Molecule* moleculePtr_;
56 
58  ClusterLink* next_;
59 
61  int clusterId_;
62 
63  friend class Cluster;
64 
65  };
66 
67  // Set ClusterLink to default null state.
68  inline
70  {
71  moleculePtr_ = 0;
72  next_ = 0;
73  clusterId_ = -1;
74  }
75 
76  // Set pointer to associated Molecule.
77  inline
79  { moleculePtr_ = &molecule; }
80 
81  // Get the associated molecule by reference.
82  inline
84  { return *moleculePtr_; }
85 
86  // Get a pointer to the next link.
87  inline
89  { return next_; }
90 
91  // Get the id of the associated cluster.
92  inline
94  { return clusterId_; }
95 
96 }
97 #endif
Cluster of molecules.
Definition: Cluster.h:31
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
A physical molecule (a set of covalently bonded Atoms).