ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/types/DataHolder.hpp
(Generate patch)

Comparing trunk/OOPSE-3.0/src/types/DataHolder.hpp (file contents):
Revision 2472 by tim, Fri Dec 2 18:43:41 2005 UTC vs.
Revision 2544 by tim, Wed Jan 11 19:01:20 2006 UTC

# Line 43 | Line 43
43   #define TYPES_DATAHOLDER_HPP
44  
45   #include <iostream>
46
46   #include <string>
47 + #include <sstream>
48   #include <map>
49   #include <set>
50   #include "math/Vector3.hpp"
51   #include "utils/ParameterManager.hpp"
52   #include "io/ParamConstraint.hpp"
53   #include "utils/simError.h"
54 + #include "utils/OOPSEException.hpp"
55 + #include "utils/StringUtils.hpp"
56   namespace oopse {
57  
58   class DataHolder {
# Line 64 | Line 66 | class DataHolder {
66                if (i != parameters_.end()) {
67                     bool result = i->second->setData(val);
68                     if (!result ) {
69 <                  std::cout <<   "Error in parsing " << keyword << ": expect " << i->second->getParamType() <<"\n";
69 >                     std::stringstream ss;
70 >                  ss <<   "Error in parsing " << keyword << ": expect " << i->second->getParamType() <<"\n";
71 >                      throw OOPSEException(ss.str());
72                      }
73                }else if (deprecatedKeywords_.find(keyword) != deprecatedKeywords_.end()){
74                       std::cout << keyword << " is  deprecated\n";
75                }else {
76 <                     std::cout << keyword << " can not be recognized\n";
76 >                     std::stringstream ss;
77 >                     ss << keyword << " can not be recognized\n";
78 >                     throw OOPSEException(ss.str());
79                }
80          }
81  
# Line 77 | Line 83 | class DataHolder {
83            ParamMap::iterator i;
84            for (i = parameters_.begin(); i != parameters_.end(); ++i) {
85              if (!i->second->isOptional() && i->second->empty()) {
86 <                std::cout <<  i->second->getKeyword()  << " must be set\n";
86 >                std::stringstream ss;
87 >                ss <<  i->second->getKeyword()  << " must be set\n";
88 >                throw OOPSEException(ss.str());
89              }
90            }
91          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines