/** * FileWriter.cc * * Created on: 02 oct. 2014 * Author: AKKA */ #include "FileWriter.hh" namespace AMDA { namespace ParamOutputImpl { namespace Download { namespace FileWriter { FileWriter::FileWriter(AMDA::Parameters::ParameterManager& pParameterManager) : _parameterManager(pParameterManager) { } FileWriter::~FileWriter(void) { } void FileWriter::sortParametersInfoByType(std::string crtParamId, std::set,cmpParamInfoStruct>& baseParamsInfoList, std::set,cmpParamInfoStruct>& derivedParamsInfoList) { //get current parameter AMDA::Parameters::ParameterSPtr crtParam = _parameterManager.getParameter(crtParamId); if (crtParam == nullptr) return; //get current param info AMDA::Info::ParamInfoSPtr paramInfo = AMDA::Info::ParamMgr::getInstance()->getParamInfoFromId(crtParam->getInfoId()); if (paramInfo == nullptr) return; if (paramInfo->getProcessInfo().empty()) { //it's a base parameter baseParamsInfoList.insert(std::pair(crtParamId,paramInfo)); } else { //it's a derived parameter derivedParamsInfoList.insert(std::pair(crtParamId,paramInfo)); for (auto linkedParamId : paramInfo->getLinkedParamList()) sortParametersInfoByType(linkedParamId, baseParamsInfoList, derivedParamsInfoList); } } } /* namespace FileWriter */ } /* namespace Download */ } /* namespace ParamOutputImpl */ } /* namespace AMDA */