summaryrefslogtreecommitdiffstats
path: root/src/outputlist.h
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-08-09 18:55:22 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-08-24 14:08:14 (GMT)
commit0815bb7d5c99fccdbdba24fb933f9e7fce29bbc6 (patch)
treef3af0df1bd26f367220386ab4e011a27c9b341fd /src/outputlist.h
parent8b3efba55c297d9af5274bf525e53417b78e8be3 (diff)
downloadDoxygen-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.h')
-rw-r--r--src/outputlist.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/outputlist.h b/src/outputlist.h
index 9393a59..003e508 100644
--- a/src/outputlist.h
+++ b/src/outputlist.h
@@ -37,11 +37,18 @@ class DocRoot;
class OutputList : public OutputDocInterface
{
public:
- OutputList(bool);
+ OutputList();
+ OutputList(const OutputList &ol);
+ OutputList &operator=(const OutputList &ol);
virtual ~OutputList();
- void add(OutputGenerator *);
- uint count() const { return static_cast<uint>(m_outputs.size()); }
+ template<class Generator>
+ void add()
+ {
+ m_outputs.emplace_back(std::make_unique<Generator>());
+ }
+
+ size_t size() const { return m_outputs.size(); }
void disableAllBut(OutputGenerator::OutputType o);
void enableAll();
@@ -493,8 +500,8 @@ class OutputList : public OutputDocInterface
}
}
- OutputList(const OutputList &ol);
std::vector< std::unique_ptr<OutputGenerator> > m_outputs;
+
};
#endif