+int AliHLTConfigurationHandler::AddSubstitution(const char* componentId, const AliHLTConfiguration& subst)
+{
+ /// add component substitution for components of specified id
+ if (!componentId) return -EINVAL;
+ if (!fgpSubstitutions) fgpSubstitutions=new TMap;
+ if (!fgpSubstitutions) return -ENOMEM;
+ fgpSubstitutions->SetOwnerKeyValue(kTRUE);
+
+ fgpSubstitutions->Add(new TObjString(componentId), new AliHLTConfiguration(subst));
+
+ return 0;
+}
+
+int AliHLTConfigurationHandler::AddSubstitution(const AliHLTConfiguration& conf , const AliHLTConfiguration& subst)
+{
+ /// add component substitution for components of specified id
+ if (!fgpSubstitutions) fgpSubstitutions=new TMap;
+ if (!fgpSubstitutions) return -ENOMEM;
+ fgpSubstitutions->SetOwnerKeyValue(kTRUE);
+
+ fgpSubstitutions->Add(new AliHLTConfiguration(conf), new AliHLTConfiguration(subst));
+
+ return 0;
+}
+
+const AliHLTConfiguration* AliHLTConfigurationHandler::FindSubstitution(const AliHLTConfiguration& conf)
+{
+ /// find component substitution for a configuration
+ if (!fgpSubstitutions) return NULL;
+ TObject* value=NULL;
+
+ // check for specific configuration
+ value=fgpSubstitutions->GetValue(conf.GetName());
+ if (value) return dynamic_cast<AliHLTConfiguration*>(value);
+
+ // check for component Id
+ value=fgpSubstitutions->GetValue(conf.GetComponentID());
+ if (value) return dynamic_cast<AliHLTConfiguration*>(value);
+
+ return NULL;
+}