Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: LFS, Container Registry, Job Artifacs, Uploads (Wiki, Bilder, Projekt-Exporte). Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit 01b7b1d7 authored by Leander Schulten's avatar Leander Schulten
Browse files

Support loading of LoopPrograms

parent 682a6745
......@@ -150,7 +150,10 @@ typedef Modules::Program* (*CreateProgramm)(unsigned int index);
for(int counter = 0; ;++counter){
auto fileName = name + "____" + QString::number(counter)+ SHARED_LIB_FILE_SUFFIX;
if(!QFileInfo::exists(fileName)&&!QFileInfo::exists(fileName+".old")){
Q_ASSERT(QFile::rename(name,fileName));
if(!QFile::rename(name,fileName)){
auto msg = ("Renaming from " + name + " to " + fileName + " does not work").toLatin1();
qCritical(msg.data());
}
return fileName;
}
}
......@@ -180,7 +183,15 @@ typedef Modules::Program* (*CreateProgramm)(unsigned int index);
}
});
}if(f(MODUL_TYPE::LoopProgram)){
//loadType(lib,programms,"LoopProgramm",lastLibraryIdentifier);
loadType(lib,programms,"LoopProgram",lastLibraryIdentifier,[&](const auto p){
if(replaceNewInPBs){
for(const auto & pb : ProgramBlockManager::model){
for(const auto & v : pb->getUsedProgramsByName(p->name())){
pb->replaceProgram(v,std::shared_ptr<Program>(p->create()));
}
}
}
});
}if(f(MODUL_TYPE::Filter)){
loadType(lib,filter,"Filter",lastLibraryIdentifier,[&](const auto p){
if(replaceNewInPBs){
......
......@@ -8,6 +8,8 @@
#include "consumer.hpp"
#include <cstring>
#include "property.hpp"
#include "programms/loopprogram.hpp"
#include "programms/boostloopprogramcontextswitcher.h"
#include <QString>
#include <QFile>
......@@ -321,7 +323,16 @@ signals:
for(unsigned int i = 0 ; i < getNumberOfProgramms();++i){
const auto name = getNameOfProgramm(i);
const auto desc = getDescriptionOfProgramm(i);
const auto func = [=](){return createProgramm(i);};
std::function<Type*(void)> func = [](){return nullptr;};
if("LoopProgram"s == Typename){
func = [=]() -> Type*{
LoopProgram * lp = static_cast<LoopProgram*>(static_cast<void*>(createProgramm(i)));
lp->setContextSwitcher(std::make_unique<BoostLoopProgramContextSwitcher>());
return static_cast<Type*>(static_cast<void*>(lp));
};
}else{
func = [=](){return createProgramm(i);};
}
auto iter = c.find({name,desc});
const detail::Entry<Type> * p;
if(iter!=c.cend()){ // remove old entry if exists
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment