ESyS-Particle  2.3.2
Packer.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 
14 #ifndef ESYS_LSMPACKER_H
15 #define ESYS_LSMPACKER_H
16 
19 #include <boost/pool/object_pool.hpp>
20 #include <boost/shared_ptr.hpp>
21 
22 #include <set>
23 
24 namespace esys
25 {
26  namespace lsm
27  {
31  template <typename TmplParticleCollection>
32  class Packer
33  {
34  public:
35  typedef TmplParticleCollection ParticleCollection;
37  typedef boost::shared_ptr<ParticleCollection> ParticleCollectionPtr;
39  typedef boost::object_pool<Particle> ParticlePool;
40  typedef boost::shared_ptr<ParticlePool> ParticlePoolPtr;
42  typedef boost::shared_ptr<NTable> NTablePtr;
43  typedef
46  typedef
49 
50  Packer(NTablePtr nTablePtr);
51 
52  Packer(ParticlePoolPtr particlePoolPtr, NTablePtr nTablePtr);
53 
54  virtual ~Packer();
55 
56  virtual void generate() = 0;
57 
58  int getNumParticles() const;
59 
60  int getNextParticleId();
61 
62  void setNTablePtr(NTablePtr nTablePtr);
63  NTable &getNTable();
64  const NTable &getNTable() const;
65 
68  const ParticlePool &getParticlePool() const;
69 
72 
73  Particle &constructParticle(const Particle &particle);
74 
76 
78 
79  bool contains(const Particle &particle) const;
80 
81  Particle &createAndInsertParticle(const Particle &particle);
82 
83  protected:
84 
85  typedef std::set<int> IdSet;
86 
87  private:
92  };
93  }
94 }
95 
96 #include "Geometry/Packer.hpp"
97 
98 #endif