ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/io/StatWriter.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-2.0/src/io/StatWriter.cpp (file contents):
Revision 1727 by tim, Thu Nov 11 16:41:58 2004 UTC vs.
Revision 1808 by tim, Tue Nov 30 23:14:29 2004 UTC

# Line 4 | Line 4 | StatWriter::StatWriter( const std::string& filename, c
4   #include "io/StatWriter.hpp"
5   #include "utils/simError.h"
6  
7 < StatWriter::StatWriter( const std::string& filename, const StatsBitSet& mask) mask_(mask){
7 > namespace oopse {
8 > StatWriter::StatWriter( const std::string& filename, const StatsBitSet& mask) : mask_(mask){
9  
10   #ifdef IS_MPI
11    if(worldRank == 0 ){
12   #endif // is_mpi
13  
14 <    statfile_.open(filename.c_str(), ios::out | ios::trunc );
14 >    statfile_.open(filename.c_str(), std::ios::out | std::ios::trunc );
15      
16      if( !statfile_ ){
17        
# Line 52 | Line 53 | void StatWriter::writeTitle() {
53   #endif // is_mpi
54  
55          //write title
56 <        statfile_ << "#"
57 <            for (int i =0; i < mask_.size(); ++i) {
58 <                if (mask_[i]) {
59 <                statfile_ << "\t" << Stats::getTitle(i) << "(" << Stats::getUnits(i) << ")"
59 <                }
56 >        statfile_ << "#";
57 >        for (int i =0; i < mask_.size(); ++i) {
58 >            if (mask_[i]) {
59 >            statfile_ << "\t" << Stats::getTitle(i) << "(" << Stats::getUnits(i) << ")";
60              }
61 +        }
62          statfile_ << std::endl;
63  
64   #ifdef IS_MPI
# Line 75 | Line 76 | void StatWriter::writeStat(Stats* s){
76  
77          for (int i =0; i < mask_.size(); ++i) {
78              if (mask_[i]) {
79 <                statfile_ << "\t" << s->statData[i];
79 >                statfile_ << "\t" << (*s)[i];
80              }
81          }
82          statfile_ << std::endl;
# Line 87 | Line 88 | void StatWriter::writeStat(Stats* s){
88   #endif // is_mpi
89   }
90  
91 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines