Public Member Functions | |
virtual Property * | subProp (const QString &sub_name) |
Return the first child Property with the given name, or the FailureProperty if no child has the name. |
Definition at line 44 of file property.cpp.
virtual Property* rviz::FailureProperty::subProp | ( | const QString & | sub_name | ) | [inline, virtual] |
Return the first child Property with the given name, or the FailureProperty if no child has the name.
If no child is found with the given name, an instance of a special Property subclass named FailureProperty is returned and an error message is printed to stdout. FailureProperty::subProp() always returns itself, which means you can safely chain a bunch of subProp() calls together and not have a crash even if one of the sub-properties does not actually exist. For instance:
float width = prop->subProp( "Dimenshons" )->subProp( "Width" )->getValue().toFloat();
If the first property prop
has a "Dimensions" property but not a "Dimenshons" one, width
will end up set to 0 and an error message will be printed, but the program will not crash here.
This is an Order(N) operation in the number of subproperties.
Reimplemented from rviz::Property.
Definition at line 47 of file property.cpp.