Skip to content

Commit

Permalink
Refactor TopologyState (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosa11aei committed Aug 5, 2024
1 parent 2597dc3 commit 97f9df4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ac_tool/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ def generateHppFile(toRebuild, topology_in, topologydefs):
# TODO: This isn't dynamic enough. Need to find a way to make this more dynamic
importPath = f"{main_module}/Top/{main_module}TopologyDefs.hpp"

importName = f'#include "{importPath}"\n'
namespaceName = f"using namespace {main_module};\n"
importName = f'#include "{importPath}"\n\n'
forwardDeclaration = f"namespace {main_module} {{ struct TopologyState; }}\nusing TopologyState = {main_module}::TopologyState;\n\n"

for line in lines:
if "ifndef" in line:
Expand All @@ -372,7 +372,7 @@ def generateHppFile(toRebuild, topology_in, topologydefs):
actLines.append(line)

actLines.insert(0, importName)
actLines.insert(1, namespaceName)
actLines.insert(1, forwardDeclaration)

outputDir = os.path.dirname(FPP_OUTPUT)
outputDir = os.path.dirname(outputDir)
Expand Down

0 comments on commit 97f9df4

Please sign in to comment.