Free Electron
SimPlant.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __vegetation_SimPlant_h__
8 #define __vegetation_SimPlant_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Move all plants
17 
18  @ingroup vegetation
19 *//***************************************************************************/
20 class FE_DL_EXPORT SimPlant: virtual public HandlerI,
21  virtual public WorkI
22 {
23  public:
24  SimPlant(void) {}
25 
26  //* as HandlerI
27 virtual void handle(Record &a_forestRecord);
28 
29  //* As WorkI
30 virtual WorkI::Threading threading(void)
31  { return WorkI::Threading(NULL); }
32 virtual void setThreading(WorkI::Threading a_threading) {}
33 virtual void run(I32 a_id,sp<SpannedRange> a_spSpannedRange);
34 virtual void run(I32 a_id,sp<SpannedRange> a_spSpannedRange,
35  String a_stage)
36  { run(a_id,a_spSpannedRange); }
37 
38  private:
39  void update(Plant& a_rPlantRV);
40 
41  Forest m_forestRV;
42  Plant m_plantRV;
43  RecordArrayView<Plant> m_plantRAV;
44  PlantSeed m_seedRV;
45 
46  class PlantWorker: public Thread::Functor
47  {
48  public:
49  PlantWorker(sp< JobQueue<I32> > a_spJobQueue,
50  U32 a_id,String a_stage):
51  m_id(a_id),
52  m_hpJobQueue(a_spJobQueue) {}
53 
54  virtual void operate(void);
55 
56  void setObject(sp<Counted> spCounted)
57  { m_hpSimPlant=sp<Component>(spCounted); }
58 
59  private:
60  U32 m_id;
61  hp< JobQueue<I32> > m_hpJobQueue;
62  hp<SimPlant> m_hpSimPlant;
63  };
64 
65  sp< Gang<PlantWorker,I32> > m_spGang;
66  I32 m_bundleSize;
67 };
68 
69 } /* namespace ext */
70 } /* namespace fe */
71 
72 #endif /* __vegetation_SimPlant_h__ */
kernel
Definition: namespace.dox:3
Move all plants.
Definition: SimPlant.h:20
RecordView Iteration over a RecordArray.
Definition: RecordArrayView.h:37
PlantSeed RecordView.
Definition: PlantSeed.h:22
Plant RecordView.
Definition: Plant.h:24
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
Safe handle for shared pointer.
Definition: Handled.h:61
Automatically reference-counted string container.
Definition: String.h:128
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Execute a Range.
Definition: WorkI.h:20
Forest RecordView.
Definition: Forest.h:23