diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-08-09 18:55:22 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-08-24 14:08:14 (GMT) |
commit | 0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6 (patch) | |
tree | f3af0df1bd26f367220386ab4e011a27c9b341fd /src/outputlist.cpp | |
parent | 8b3efba55c297d9af5274bf525e53417b78e8be3 (diff) | |
download | Doxygen-0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6.zip Doxygen-0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6.tar.gz Doxygen-0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6.tar.bz2 |
Refactoring: OutputList & OutputGen
- Initialized member variables inside the class
- Added copy & assign operators for OutputGenerator and Derived classes.
- throw a runtime exception when OutputGenerator is copied while is file
is still in progress.
- Added clone method to make a copy of OutputList.
- Moved the implementation of enable() & disable() and friend into
OutputGen instead of having the same implementation in each derived
class.
- Made m_dir and m_fileName readonly (members dir() and fileName())
- Removed call to new while adding generators to OutputList
- Replaced QStack by std::stack for the "enabled" state.
Diffstat (limited to 'src/outputlist.cpp')
-rw-r--r-- | src/outputlist.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/outputlist.cpp b/src/outputlist.cpp index e942465..3e05dac 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -30,19 +30,35 @@ #include "docparser.h" #include "vhdldocgen.h" -OutputList::OutputList(bool) + +OutputList::OutputList() { //printf("OutputList::OutputList()\n"); } -OutputList::~OutputList() +OutputList::OutputList(const OutputList &ol) { - //printf("OutputList::~OutputList()\n"); + for (const auto &og : ol.m_outputs) + { + m_outputs.emplace_back(og->clone()); + } +} + +OutputList &OutputList::operator=(const OutputList &ol) +{ + if (this!=&ol) + { + for (const auto &og : ol.m_outputs) + { + m_outputs.emplace_back(og->clone()); + } + } + return *this; } -void OutputList::add(OutputGenerator *og) +OutputList::~OutputList() { - if (og) m_outputs.emplace_back(og); + //printf("OutputList::~OutputList()\n"); } void OutputList::disableAllBut(OutputGenerator::OutputType o) |