Skip to content

Commit

Permalink
#3332
Browse files Browse the repository at this point in the history
  • Loading branch information
Helge Mathee committed Oct 16, 2014
1 parent 9068cf9 commit 5b6530f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions DGGraphImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,13 +1190,15 @@ bool DGGraphImpl::checkErrors(std::string * errorOut)
return result;
}

std::string DGGraphImpl::generateKLOperatorParameterList()
std::string DGGraphImpl::generateKLOperatorParameterList(bool useLineBreaks)
{
std::string result;
for(DGPortIt it=mDGPorts.begin();it!=mDGPorts.end();it++)
{
if(result.length() > 0)
result += ", ";
if(useLineBreaks)
result += "\n ";
if(it->second->getMode() == DGPortImpl::Mode_IN)
result += "in ";
else
Expand All @@ -1222,7 +1224,7 @@ std::string DGGraphImpl::generateKLOperatorSourceCode(
) {
std::string code;

std::string params = generateKLOperatorParameterList();
std::string params = generateKLOperatorParameterList(true);
std::string requireCode = "require Math;\n";
std::string bodyCode;
std::string executeParallelFunction;
Expand Down Expand Up @@ -1330,10 +1332,11 @@ std::string DGGraphImpl::generateKLOperatorSourceCode(
code += requireCode + "\n";
code += executeParallelFunction;
code += additionalFunctions;
code += "operator "+name+"("+params+") {\n";
code += "operator "+name+"("+params+"\n) {\n";
code += bodyCode;
code += executeParallelBody;
code += additionalBody;
code += " \n";
code += "}\n";

return code;
Expand Down
2 changes: 1 addition & 1 deletion DGGraphImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace FabricSpliceImpl
*/

/// returns KL source code for the parameter list for all available ports
std::string generateKLOperatorParameterList();
std::string generateKLOperatorParameterList(bool useLineBreaks = false);

/// returns dummy source code for a KL operator
std::string generateKLOperatorSourceCode(const std::string & name, const std::string & additionalBody = "", const std::string & additionalFunctions = "", const std::string & executeParallelMember = "");
Expand Down

0 comments on commit 5b6530f

Please sign in to comment.