ESyS-Particle  2.3.2
BasicInteraction.h
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __BASICINTERACTION_H
14 #define __BASICINTERACTION_H
15 
16 //-- IO includes --
17 #include <iostream>
18 
28 {
29  public:
30  typedef int Id;
31  typedef int Tag;
32 
33  private:
37 
38  public:
39 
40  BasicInteraction(Id id1, Id id2,Tag tag=0);
41 
42  Id first() const {return m_p1;}
43 
44  Id second() const {return m_p2;}
45 
46  Id getP1Id() const
47  {
48  return first();
49  }
50 
51  Id getP2Id() const
52  {
53  return second();
54  }
55 
56  Tag getTag() const
57  {
58  return m_tag;
59  }
60 
61  template <typename TmplVisitor>
62  void visit(TmplVisitor &visitor) const
63  {
64  visitor.visitBasicInteraction(*this);
65  }
66 
67  friend std::ostream& operator<<(std::ostream&,const BasicInteraction&);
68  friend class BILess;
69 };
70 
78 class BILess
79 {
80  public:
81  bool operator()(const BasicInteraction&,const BasicInteraction&);
82 };
83 
84 #endif //__BASICINTERACTION_H