mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-02 00:44:43 -05:00
Some more refactoring of the documentation feature
This commit is contained in:
@@ -37,8 +37,11 @@ public:
|
||||
std::string filename;
|
||||
};
|
||||
|
||||
Documented(std::string name, std::string jsonName, std::vector<HandlebarTemplate> handlebarTemplates,
|
||||
Documented(std::string name, std::string jsonName,
|
||||
std::vector<HandlebarTemplate> handlebarTemplates,
|
||||
std::string javascriptFilename);
|
||||
|
||||
virtual ~Documented() = default;
|
||||
|
||||
void writeDocumentation(const std::string& filename);
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef __OPENSPACE_CORE___FACTORYMANAGER___H__
|
||||
#define __OPENSPACE_CORE___FACTORYMANAGER___H__
|
||||
|
||||
#include <openspace/util/documented.h>
|
||||
|
||||
#include <ghoul/misc/exception.h>
|
||||
#include <ghoul/misc/templatefactory.h>
|
||||
|
||||
@@ -37,7 +39,7 @@ namespace openspace {
|
||||
* them available through the #addFactory and #factory methods. Each
|
||||
* ghoul::TemplateFactory can only be added once and can be accessed by its type.
|
||||
*/
|
||||
class FactoryManager {
|
||||
class FactoryManager : public Documented {
|
||||
public:
|
||||
/// This exception is thrown if the ghoul::TemplateFactory could not be found in the
|
||||
/// #factory method
|
||||
@@ -55,6 +57,8 @@ public:
|
||||
/// The type describing the ghoul::TemplateFactory that could not be found
|
||||
std::string type;
|
||||
};
|
||||
|
||||
FactoryManager();
|
||||
|
||||
/**
|
||||
* Static initializer that initializes the static member. This needs to be done before
|
||||
@@ -104,17 +108,9 @@ public:
|
||||
template <class T>
|
||||
ghoul::TemplateFactory<T>* factory() const;
|
||||
|
||||
/**
|
||||
* Writes a documentation for the FactoryMananger that contains all of the registered
|
||||
* factories and for each factory all registered class names.
|
||||
* \param file The file to which the documentation will be written
|
||||
* \param type The type of documentation that will be written
|
||||
* \pre \p file must not be empty
|
||||
* \pre \p type must not be empty
|
||||
*/
|
||||
void writeDocumentation(const std::string& file, const std::string& type);
|
||||
|
||||
private:
|
||||
std::string generateJson() const override;
|
||||
|
||||
/// Singleton member for the Factory Manager
|
||||
static FactoryManager* _manager;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user