Changeset 2920 for trunk/src/STIdxIter.h
- Timestamp:
- 04/07/14 10:04:18 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STIdxIter.h
r2918 r2920 15 15 using namespace std ; 16 16 using namespace casa ; 17 18 namespace { 19 vector<string> split(const string &str, char delim) 20 { 21 vector<string> result; 22 size_t current = 0; 23 size_t found; 24 while ((found = str.find_first_of(delim, current)) != string::npos) { 25 result.push_back(string(str, current, found - current)); 26 current = found + 1; 27 } 28 result.push_back(string(str, current, str.size() - current)); 29 return result; 30 } 31 } // anonymous namespace 17 32 18 33 namespace asap { … … 160 175 { 161 176 public: 177 template<class T> 178 static void Iterate(T &processor, const string cols_list) 179 { 180 vector<string> cols = split(cols_list, ','); 181 // for (vector<string>::iterator i = cols.begin(); i != cols.end(); ++i) 182 // cout << *i << endl; 183 STIdxIter2 iter(processor.target(), cols); 184 STSelector sel ; 185 while ( !iter.pastEnd() ) { 186 const Record current = iter.currentValue() ; 187 Vector<uInt> rows = iter.getRows( SHARE ) ; 188 // any process 189 processor.Process(cols, current, rows); 190 // go next 191 iter.next() ; 192 } 193 } 162 194 STIdxIter2() ; 163 195 STIdxIter2( const string &name,
Note: See TracChangeset
for help on using the changeset viewer.