#include <OSGGraphOp.h>
Public Member Functions | |
| ParamSet (const std::string ¶ms) | |
| bool | operator() (const char *name, std::string &val) |
| bool | operator() (const char *name, Real32 &val) |
| bool | operator() (const char *name, UInt16 &val) |
| bool | operator() (const char *name, UInt32 &val) |
| bool | operator() (const char *name, bool &val) |
| void | markUsed (const char *name) |
| std::string | getUnusedParams (void) |
Private Types | |
| typedef std::map< std::string, std::string > | valuesT |
| typedef std::map< std::string, bool > | usedT |
Private Attributes | |
| valuesT | _values |
| usedT | _used |
Definition at line 128 of file OSGGraphOp.h.
|
|
Definition at line 148 of file OSGGraphOp.h. |
|
|
Definition at line 149 of file OSGGraphOp.h. |
|
|
Definition at line 184 of file OSGGraphOp.cpp. References _values, and FDEBUG. 00184 : 00185 _values(), 00186 _used() 00187 { 00188 std::string::const_iterator it = params.begin(), end = params.end(); 00189 00190 std::string key, value; 00191 00192 while(it != end) 00193 { 00194 char c = 0; 00195 00196 key = ""; 00197 value = ""; 00198 00199 // Read key 00200 while(it != end) 00201 { 00202 c = *it++; 00203 00204 if(c == ' ' || c == '=') 00205 break; 00206 00207 key += tolower(c); 00208 } 00209 00210 // Do we have a value? Read it 00211 if (it != end && c == '=') 00212 { 00213 while(it != end) 00214 { 00215 c = *it++; 00216 00217 if(c == ' ') 00218 break; 00219 00220 value += c; 00221 } 00222 } 00223 00224 // Add key, value pair 00225 00226 FDEBUG(("GraphOp::ParamSet: key='%s', value='%s'\n", key.c_str(), 00227 value.c_str())); 00228 00229 _values.insert(valuesT::value_type(key, value)); 00230 00231 // Skip to next param 00232 00233 while(it != end && (*it == ' ')); 00234 } 00235 }
|
|
||||||||||||
|
Definition at line 237 of file OSGGraphOp.cpp. References _used, and _values. 00238 { 00239 valuesT::iterator it = _values.find(name); 00240 00241 if(it != _values.end()) 00242 { 00243 val = (*it).second; 00244 00245 _used[name] = true; 00246 00247 return true; 00248 } 00249 return false; 00250 }
|
|
||||||||||||
|
Definition at line 252 of file OSGGraphOp.cpp. References _used, and _values. 00253 { 00254 valuesT::iterator it = _values.find(name); 00255 00256 if(it != _values.end()) 00257 { 00258 const Char8* c = (*it).second.c_str(); 00259 FieldDataTraits<Real32>::getFromString(val, c); 00260 00261 _used[name] = true; 00262 return true; 00263 } 00264 return false; 00265 }
|
|
||||||||||||
|
Definition at line 267 of file OSGGraphOp.cpp. References _used, and _values. 00268 { 00269 valuesT::iterator it = _values.find(name); 00270 00271 if(it != _values.end()) 00272 { 00273 const Char8* c = (*it).second.c_str(); 00274 FieldDataTraits<UInt16>::getFromString(val, c); 00275 00276 _used[name] = true; 00277 return true; 00278 } 00279 return false; 00280 }
|
|
||||||||||||
|
Definition at line 282 of file OSGGraphOp.cpp. References _used, and _values. 00283 { 00284 valuesT::iterator it = _values.find(name); 00285 00286 if(it != _values.end()) 00287 { 00288 const Char8* c = (*it).second.c_str(); 00289 FieldDataTraits<UInt32>::getFromString(val, c); 00290 00291 _used[name] = true; 00292 return true; 00293 } 00294 return false; 00295 }
|
|
||||||||||||
|
Definition at line 297 of file OSGGraphOp.cpp. References _used, and _values. 00298 { 00299 valuesT::iterator it = _values.find(name); 00300 00301 if(it != _values.end()) 00302 { 00303 if((*it).second.length() == 0) 00304 { 00305 val = true; 00306 } 00307 else 00308 { 00309 const Char8* c = (*it).second.c_str(); 00310 FieldDataTraits2<bool>::getFromString(val, c); 00311 } 00312 00313 _used[name] = true; 00314 return true; 00315 } 00316 return false; 00317 }
|
|
|
Definition at line 319 of file OSGGraphOp.cpp. References _used. 00320 { 00321 _used[name] = true; 00322 }
|
|
|
Definition at line 324 of file OSGGraphOp.cpp. References _used, and _values. 00325 { 00326 std::string out; 00327 00328 for (valuesT::iterator it = _values.begin(); it != _values.end(); ++it) 00329 { 00330 usedT::iterator uit = _used.find((*it).first); 00331 00332 if(uit == _used.end()) 00333 { 00334 if(out.length()) 00335 out += " "; 00336 00337 out += (*it).first; 00338 } 00339 } 00340 00341 return out; 00342 }
|
|
|
Definition at line 151 of file OSGGraphOp.h. Referenced by getUnusedParams(), operator()(), and ParamSet(). |
|
|
Definition at line 152 of file OSGGraphOp.h. Referenced by getUnusedParams(), markUsed(), and operator()(). |
1.4.3