Particle Identification and Tracking
wrapper_o_file.h
Go to the documentation of this file.
1 //Copyright 2008,2009 Thomas A Caswell
2 //tcaswell@uchicago.edu
3 //http://jfi.uchicago.edu/~tcaswell
4 //
5 //This program is free software; you can redistribute it and/or modify
6 //it under the terms of the GNU General Public License as published by
7 //the Free Software Foundation; either version 3 of the License, or (at
8 //your option) any later version.
9 //
10 //This program is distributed in the hope that it will be useful, but
11 //WITHOUT ANY WARRANTY; without even the implied warranty of
12 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 //General Public License for more details.
14 //
15 //You should have received a copy of the GNU General Public License
16 //along with this program; if not, see <http://www.gnu.org/licenses>.
17 //
18 //Additional permission under GNU GPL version 3 section 7
19 //
20 //If you modify this Program, or any covered work, by linking or
21 //combining it with MATLAB (or a modified version of that library),
22 //containing parts covered by the terms of MATLAB User License, the
23 //licensors of this Program grant you additional permission to convey
24 //the resulting work.
25 #include "wrapper_o.h"
26 #include <fstream>
27 
28 #ifndef WRAPPER_O_FILE
29 #define WRAPPER_O_FILE
30 namespace utilities{
31 //set up to use stl
32 using std::string;
33 using std::vector;
34 using std::map;
35 using std::cout;
36 using std::pair;
37 using std::endl;
38 using std::ofstream;
39 //forward declerations
40 class params_file;
48 private:
49 
50 protected:
52  string fname;
53 
55  vector<double > data;
56 
58  ofstream f_out;
59 
61  int cols;
62 
64  void initialize(params_file* param);
65 
68  void store_data(int index, int pos, double val);
69 
71  map<utilities::D_TYPE, int> contents;
72 
73 
74 
75 public:
78  // int add_particle();
79 
81  void print() const;
82 
83  void print(int ind);
84 
86  //nuke this eventully
87  wrapper_o_file(params_file* params);
88 
89 
90  int num_entries() const{return data.size();}
91 
92  // virtual void set_value(int ind, utilities::D_TYPE type,double val);
93 
94 
95 
96  void set_new_value(utilities::D_TYPE type, double val);
97  void end_new_particle();
98  void finalize_wrapper();
99  void initialize_wrapper();
100  void reset_wrapper(params * param);
101  void start_new_particle();
102 
103 
105  // void finalize();
106 };
107 }
108 
109 #endif