-boost::shared_ptr<ModelAPI_AttributeDocRef> Model_Data::document(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_AttributeDocRef>();
- }
- boost::shared_ptr<ModelAPI_AttributeDocRef> aRes = boost::dynamic_pointer_cast<
- ModelAPI_AttributeDocRef>(aFound->second);
- if (!aRes) {
- // TODO: generate error on invalid attribute type request
- }
- return aRes;
-}
-
-boost::shared_ptr<ModelAPI_AttributeDouble> Model_Data::real(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_AttributeDouble>();
- }
- boost::shared_ptr<ModelAPI_AttributeDouble> aRes = boost::dynamic_pointer_cast<
- ModelAPI_AttributeDouble>(aFound->second);
- if (!aRes) {
- // TODO: generate error on invalid attribute type request
- }
- return aRes;
-}
-
-boost::shared_ptr<ModelAPI_AttributeInteger> Model_Data::integer(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_AttributeInteger>();
- }
- boost::shared_ptr<ModelAPI_AttributeInteger> aRes = boost::dynamic_pointer_cast<
- ModelAPI_AttributeInteger>(aFound->second);
- if (!aRes) {
- // TODO: generate error on invalid attribute type request
- }
- return aRes;
-}
-
-boost::shared_ptr<ModelAPI_AttributeBoolean> Model_Data::boolean(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_AttributeBoolean>();
- }
- boost::shared_ptr<ModelAPI_AttributeBoolean> aRes = boost::dynamic_pointer_cast<
- ModelAPI_AttributeBoolean>(aFound->second);
- if (!aRes) {
- // TODO: generate error on invalid attribute type request
- }
- return aRes;
-}
-
-boost::shared_ptr<ModelAPI_AttributeString> Model_Data::string(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_AttributeString>();
- }
- boost::shared_ptr<ModelAPI_AttributeString> aRes =
- boost::dynamic_pointer_cast<ModelAPI_AttributeString>(aFound->second);
- if (!aRes) {
- // TODO: generate error on invalid attribute type request
- }
- return aRes;
-
-}
-
-boost::shared_ptr<ModelAPI_AttributeReference> Model_Data::reference(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_AttributeReference>();
- }
- boost::shared_ptr<ModelAPI_AttributeReference> aRes = boost::dynamic_pointer_cast<
- ModelAPI_AttributeReference>(aFound->second);
- if (!aRes) {
- // TODO: generate error on invalid attribute type request
- }
- return aRes;
-}
-
-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;
-}
-
-boost::shared_ptr<ModelAPI_AttributeSelectionList>
- Model_Data::selectionList(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_AttributeSelectionList>();
- }
- boost::shared_ptr<ModelAPI_AttributeSelectionList> aRes =
- boost::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(aFound->second);
- if (!aRes) {
- // TODO: generate error on invalid attribute type request