[cig-commits] [commit] master: Change name of iterator (76893d0)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Nov 10 12:10:38 PST 2014
Repository : https://github.com/geodynamics/vq
On branch : master
Link : https://github.com/geodynamics/vq/compare/197914f4e03e55d321cae45161deafb1a5ade706...9ebb976b0ec90f56c8c1abfcd43d67ae38f64e87
>---------------------------------------------------------------
commit 76893d0a27656ee6fdff7a9b1697ef34d107c856
Author: Eric Heien <emheien at ucdavis.edu>
Date: Tue Nov 4 09:52:29 2014 -0800
Change name of iterator
>---------------------------------------------------------------
76893d0a27656ee6fdff7a9b1697ef34d107c856
quakelib/src/QuakeLibIO.cpp | 22 +++++++++++-----------
quakelib/src/QuakeLibIO.h | 24 ++++++++++++------------
src/io/ReadModelFile.cpp | 4 ++--
src/mesher.cpp | 2 +-
4 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/quakelib/src/QuakeLibIO.cpp b/quakelib/src/QuakeLibIO.cpp
index 476d419..2822234 100644
--- a/quakelib/src/QuakeLibIO.cpp
+++ b/quakelib/src/QuakeLibIO.cpp
@@ -855,7 +855,7 @@ void quakelib::ModelWorld::reset_base_coord(const LatLonDepth &new_base) {
int quakelib::ModelWorld::write_file_trace_latlon(const std::string &file_name, const float &depth_along_dip) {
std::ofstream out_file;
eiterator eit, last_element;
- fiterator fit;
+ siterator sit;
UIndex sid;
unsigned int i;
double max_alt;
@@ -865,11 +865,11 @@ int quakelib::ModelWorld::write_file_trace_latlon(const std::string &file_name,
out_file.open(file_name.c_str());
// Write traces by section
- for (fit=begin_section(); fit!=end_section(); ++fit) {
+ for (sit=begin_section(); sit!=end_section(); ++sit) {
std::vector<FaultTracePoint> trace_pts;
trace_pts.clear();
- sid = fit->id();
+ sid = sit->id();
// Start by going through all elements
max_alt = -DBL_MAX;
@@ -925,7 +925,7 @@ int quakelib::ModelWorld::write_file_trace_latlon(const std::string &file_name,
out_file << "# section_name: Name of the section\n";
// Write out the recorded trace for this fault
- out_file << fit->fault_id() << " " << trace_pts.size() << " " << fit->name() << "\n";
+ out_file << sit->fault_id() << " " << trace_pts.size() << " " << sit->name() << "\n";
// Write out the trace point header
out_file << "# latitude: Latitude of trace point\n";
@@ -1664,8 +1664,8 @@ int quakelib::ModelWorld::write_files_eqsim(const std::string &geom_file_name, c
EQSimGeometryWriter geometry_data;
EQSimFrictionWriter friction_data;
eiterator eit;
- fiterator fit;
- UIndex fid;
+ siterator sit;
+ UIndex sid;
UIndex vind, eind;
LatLonDepth base = min_bound();
Conversion c(base);
@@ -1673,16 +1673,16 @@ int quakelib::ModelWorld::write_files_eqsim(const std::string &geom_file_name, c
vind = eind = 1;
friction_data.set_lame_lambda_mu(3.2e10, 3.0e10);
- for (fit=begin_section(); fit!=end_section(); ++fit) {
+ for (sit=begin_section(); sit!=end_section(); ++sit) {
EQSimGeometrySection §ion = geometry_data.new_section();
// Set section properties
- section.set_name(fit->name());
- section.set_fid(fit->fault_id());
+ section.set_name(sit->name());
+ section.set_fid(sit->fault_id());
- fid = fit->id();
+ sid = sit->id();
- for (eit=begin_element(fid); eit!=end_element(fid); ++eit) {
+ for (eit=begin_element(sid); eit!=end_element(sid); ++eit) {
// Create SimElement to allow dip calculation
SimElement sim_elem = create_sim_element(eit->id());
diff --git a/quakelib/src/QuakeLibIO.h b/quakelib/src/QuakeLibIO.h
index 4397b70..e7bf438 100644
--- a/quakelib/src/QuakeLibIO.h
+++ b/quakelib/src/QuakeLibIO.h
@@ -407,26 +407,26 @@ namespace quakelib {
void write_ascii(std::ostream &out_stream) const;
};
- class fiterator {
+ class siterator {
private:
std::map<UIndex, ModelSection> *_map;
std::map<UIndex, ModelSection>::iterator _it;
public:
- fiterator(void) : _map(NULL) {};
- fiterator(std::map<UIndex, ModelSection> *map, std::map<UIndex, ModelSection>::iterator start) : _map(map), _it(start) {};
- fiterator &operator=(const fiterator &other) {
+ siterator(void) : _map(NULL) {};
+ siterator(std::map<UIndex, ModelSection> *map, std::map<UIndex, ModelSection>::iterator start) : _map(map), _it(start) {};
+ siterator &operator=(const siterator &other) {
_map = other._map;
_it = other._it;
return *this;
};
- bool operator==(const fiterator &other) {
+ bool operator==(const siterator &other) {
return (_map == other._map && _it == other._it);
};
- bool operator!=(const fiterator &other) {
+ bool operator!=(const siterator &other) {
return (_map != other._map || _it != other._it);
};
- fiterator &operator++(void) {
+ siterator &operator++(void) {
if (_map && _it != _map->end()) _it++;
return *this;
@@ -435,7 +435,7 @@ namespace quakelib {
return _it->second;
};
ModelSection *operator->(void) {
- return (&*(fiterator)*this);
+ return (&*(siterator)*this);
};
};
@@ -512,11 +512,11 @@ namespace quakelib {
ModelElement &element(const UIndex &ind) throw(std::domain_error);
ModelVertex &vertex(const UIndex &ind) throw(std::domain_error);
- fiterator begin_section(void) {
- return fiterator(&_sections, _sections.begin());
+ siterator begin_section(void) {
+ return siterator(&_sections, _sections.begin());
};
- fiterator end_section(void) {
- return fiterator(&_sections, _sections.end());
+ siterator end_section(void) {
+ return siterator(&_sections, _sections.end());
};
eiterator begin_element(const UIndex &fid=INVALID_INDEX) {
diff --git a/src/io/ReadModelFile.cpp b/src/io/ReadModelFile.cpp
index be276e3..6e1d60b 100644
--- a/src/io/ReadModelFile.cpp
+++ b/src/io/ReadModelFile.cpp
@@ -37,10 +37,10 @@ void ReadModelFile::dryRun(SimFramework *_sim) {
Parse the geometry file and optionally the condition and friction files.
*/
void ReadModelFile::init(SimFramework *_sim) {
- Simulation *sim = static_cast<Simulation *>(_sim);
+ Simulation *sim = static_cast<Simulation *>(_sim);
std::string file_name, file_type;
quakelib::ModelWorld world;
- quakelib::fiterator fit;
+ quakelib::siterator sit;
quakelib::eiterator eit;
int err;
quakelib::Conversion c;
diff --git a/src/mesher.cpp b/src/mesher.cpp
index 5f60335..3c4724d 100644
--- a/src/mesher.cpp
+++ b/src/mesher.cpp
@@ -55,7 +55,7 @@ std::string mem_string(const double &num_bytes) {
void print_statistics(quakelib::ModelWorld &world, const std::string &file_name) {
size_t num_elements, num_vertices;
quakelib::UIndex fid;
- quakelib::fiterator fit;
+ quakelib::siterator fit;
quakelib::eiterator eit;
std::vector<double> rake_vals, slip_rate_vals;
std::ofstream out_file;
More information about the CIG-COMMITS
mailing list