+boost::shared_ptr<ModelAPI_AttributeSelection> Model_Data::selection(const std::string& theID)
+{
+ std::map<std::string, boost::shared_ptr<ModelAPI_Attribute> >::iterator aFound = myAttrs.find(theID);
+ if (aFound == myAttrs.end()) {
+ // TODO: generate error on unknown attribute request and/or add mechanism for customization
+ return boost::shared_ptr<ModelAPI_AttributeSelection>();
+ }
+ boost::shared_ptr<ModelAPI_AttributeSelection> aRes =
+ boost::dynamic_pointer_cast<ModelAPI_AttributeSelection>(aFound->second);
+ if (!aRes) {
+ // TODO: generate error on invalid attribute type request
+ }
+ return aRes;
+}
+