ESyS-Particle  4.0.1
TriggeredVectorParticleFieldMaster.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 #ifndef __TRIGGERED_VECTOR_PARTICLE_FIELD_MASTER_H
00014 #define __TRIGGERED_VECTOR_PARTICLE_FIELD_MASTER_H
00015 
00016 //--- project includes ---
00017 #include "Fields/ParticleFieldMaster.h"
00018 #include "Foundation/RingBuffer.h"
00019  #include "Fields/MaxTrigger.h"
00020 
00021 // --- STL includes ---
00022 #include <map>
00023 
00024 using std::map;
00025 
00026 class TriggeredVectorParticleFieldMaster : public VectorParticleFieldMaster
00027 {
00028  private:
00029   RingBuffer<map<int,Vec3> > *m_save_map_buffer;
00030   RingBuffer<map<int,Vec3> > *m_pos_map_buffer;
00031   string m_base_file_name;
00032   int m_file_count;
00033   int m_tail_size;
00034   int m_tail_counter;
00035   int m_ts;
00036   bool m_is_triggered;
00037   bool m_is_writing_tail;
00038 
00039   MaxTrigger* m_Trigger;
00040 
00041   void IncrementFilename();
00042 
00043  public:
00044   TriggeredVectorParticleFieldMaster(TML_Comm*,const string&,const string&,const string&,int,int,int,const MaxTrigParams&);
00045   TriggeredVectorParticleFieldMaster(TML_Comm*,const string&,const string&,const string&,int,int,int,int,int,const MaxTrigParams&);
00046   virtual ~TriggeredVectorParticleFieldMaster();
00047 
00048   virtual void write();
00049 };
00050 #endif // __TRIGGERED_VECTOR_PARTICLE_FIELD_MASTER_H