ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/brains/Stats.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/brains/Stats.hpp (file contents):
Revision 1807 by tim, Tue Nov 30 19:58:25 2004 UTC vs.
Revision 1808 by tim, Tue Nov 30 23:14:29 2004 UTC

# Line 69 | Line 69 | class Stats{
69          };
70  
71          Stats();
72 <        const double& operator [](StatsIndex index) const {
73 <            return data_[static_cast<int>(index)];
72 >        const double& operator [](int index) const {
73 >            assert(index >=0 && index < ENDINDEX);
74 >            return data_[index];
75          }
76  
77 <        double& operator [](StatsIndex index){
78 <            return data_[static_cast<int>(index)];
77 >        double& operator [](int index){
78 >            assert(index >=0 && index < ENDINDEX);            
79 >            return data_[index];
80          }
81          
82 <        static std::string getTitle(StatsIndex index) {
83 <            return title_[static_cast<int>(index)];
82 >        static std::string getTitle(int index) {
83 >            assert(index >=0 && index < ENDINDEX);
84 >            return title_[index];
85          }
86  
87 <        static std::string getUnits(StatsIndex index) {
88 <            return units_[static_cast<int>(index)];
87 >        static std::string getUnits(int index) {
88 >            assert(index >=0 && index < ENDINDEX);
89 >            return units_[index];
90          }
91  
92          Mat3x3d getTau() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines