Skip to content

Commit 753d1ae

Browse files
committed
Engine: Add private getter for sections
1 parent ef49bc9 commit 753d1ae

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/engine/engine.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,16 @@ void Engine::registerSection(std::shared_ptr<IBlockSection> section)
337337
}
338338
}
339339

340+
std::vector<std::shared_ptr<IBlockSection>> Engine::registeredSections() const
341+
{
342+
std::vector<std::shared_ptr<IBlockSection>> ret;
343+
344+
for (const auto &[key, value] : m_sections)
345+
ret.push_back(key);
346+
347+
return ret;
348+
}
349+
340350
unsigned int Engine::functionIndex(BlockFunc f)
341351
{
342352
auto it = std::find(m_functions.begin(), m_functions.end(), f);

src/engine/engine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class Engine : public IEngine
4444
void lockFrame() override;
4545

4646
void registerSection(std::shared_ptr<IBlockSection> section) override;
47+
std::vector<std::shared_ptr<IBlockSection>> registeredSections() const;
4748
unsigned int functionIndex(BlockFunc f) override;
4849

4950
void addCompileFunction(IBlockSection *section, const std::string &opcode, BlockComp f) override;

0 commit comments

Comments
 (0)