Mercurial > hg > octave-lyh
comparison src/variables.cc @ 11069:e40e19761d06
variables.cc: Octave_map to octave_map and octave_scalar_map conversion
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 01 Oct 2010 04:30:47 -0400 |
parents | 4ab04ea74b08 |
children | 0c38b45ab49c |
comparison
equal
deleted
inserted
replaced
11068:b0eec300d3fc | 11069:e40e19761d06 |
---|---|
1216 | 1216 |
1217 size_t size (void) const { return lst.size (); } | 1217 size_t size (void) const { return lst.size (); } |
1218 | 1218 |
1219 bool empty (void) const { return lst.empty (); } | 1219 bool empty (void) const { return lst.empty (); } |
1220 | 1220 |
1221 Octave_map | 1221 octave_map |
1222 map_value (const std::string& caller_function_name, int nesting_level) const | 1222 map_value (const std::string& caller_function_name, int nesting_level) const |
1223 { | 1223 { |
1224 size_t len = lst.size (); | 1224 size_t len = lst.size (); |
1225 | 1225 |
1226 Cell name_info (len, 1); | 1226 Cell name_info (len, 1); |
1237 | 1237 |
1238 for (size_t j = 0; j < len; j++) | 1238 for (size_t j = 0; j < len; j++) |
1239 { | 1239 { |
1240 const symbol_info& si = *p++; | 1240 const symbol_info& si = *p++; |
1241 | 1241 |
1242 Octave_map ni; | 1242 octave_scalar_map ni; |
1243 | 1243 |
1244 ni.assign ("function", caller_function_name); | 1244 ni.assign ("function", caller_function_name); |
1245 ni.assign ("level", nesting_level); | 1245 ni.assign ("level", nesting_level); |
1246 | 1246 |
1247 name_info(j) = si.name; | 1247 name_info(j) = si.name; |
1256 sparse_info(j) = val.is_sparse_type (); | 1256 sparse_info(j) = val.is_sparse_type (); |
1257 complex_info(j) = val.is_complex_type (); | 1257 complex_info(j) = val.is_complex_type (); |
1258 nesting_info(j) = ni; | 1258 nesting_info(j) = ni; |
1259 } | 1259 } |
1260 | 1260 |
1261 Octave_map info; | 1261 octave_map info; |
1262 | 1262 |
1263 info.assign ("name", name_info); | 1263 info.assign ("name", name_info); |
1264 info.assign ("size", size_info); | 1264 info.assign ("size", size_info); |
1265 info.assign ("bytes", bytes_info); | 1265 info.assign ("bytes", bytes_info); |
1266 info.assign ("class", class_info); | 1266 info.assign ("class", class_info); |