MIRA
|
Class for managing manifest files. More...
#include <factory/ManifestAgent.h>
Public Member Functions | |
ManifestAgent () | |
ManifestAgent (std::string const &libraryName) | |
Set the library name which will be added to the ManifestClassInfo of every class (added with addClasses()) More... | |
ManifestAgent (std::string const &libraryName, std::vector< ClassProxy > const &classes) | |
Set the library name and calls addClasses() for the given classes. More... | |
void | setLibraryVersion (int major, int minor, int patch) |
Set version of library. More... | |
void | addClasses (std::vector< ClassProxy > const &classes) |
Add the given classes to the manifest agent The functions generates a ManifestClassInfo for every class and stores the information in the mClasses vector. More... | |
void | loadFile (Path const &filePath) |
Load a single manifest file and announce the contained classes to the class factory. More... | |
void | saveToFile (Path const &filePath) |
Serialize the mClasses vector to the given file. More... | |
void | finalize () |
Register the parent - child relationships of the previously loaded files. More... | |
template<typename Reflector > | |
void | reflect (Reflector &r) |
Protected Attributes | |
std::vector< ManifestClassInfo > | mClasses |
std::string | mLibraryName |
LibraryVersion | mVersion |
Class for managing manifest files.
The class should be used to load and store manifest files. Please note that you should use one instance of the ManifestAgent to write one manifest file. However, you can load as many manifest files as you want with a single instance. Don't forget to call finalize after all manifest files have been loaded.
|
inline |
ManifestAgent | ( | std::string const & | libraryName | ) |
Set the library name which will be added to the ManifestClassInfo of every class (added with addClasses())
ManifestAgent | ( | std::string const & | libraryName, |
std::vector< ClassProxy > const & | classes | ||
) |
Set the library name and calls addClasses() for the given classes.
void setLibraryVersion | ( | int | major, |
int | minor, | ||
int | patch | ||
) |
Set version of library.
void addClasses | ( | std::vector< ClassProxy > const & | classes | ) |
Add the given classes to the manifest agent The functions generates a ManifestClassInfo for every class and stores the information in the mClasses vector.
void loadFile | ( | Path const & | filePath | ) |
Load a single manifest file and announce the contained classes to the class factory.
The parents are not directly announced. Therefore, finalize() have to be called if one or more files are loaded. The ManifestAgent assumes that the library and manifest files resides at the same location. Therefore, the parent path of filePath is appended to the library name to load the library later on.
void saveToFile | ( | Path const & | filePath | ) |
Serialize the mClasses vector to the given file.
void finalize | ( | ) |
Register the parent - child relationships of the previously loaded files.
|
inline |
|
protected |
|
protected |
|
protected |