MIRA
Public Member Functions | Protected Attributes | List of all members
ManifestAgent Class Reference

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< ManifestClassInfomClasses
 
std::string mLibraryName
 
LibraryVersion mVersion
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ManifestAgent() [1/3]

ManifestAgent ( )
inline

◆ ManifestAgent() [2/3]

ManifestAgent ( std::string const &  libraryName)

Set the library name which will be added to the ManifestClassInfo of every class (added with addClasses())

◆ ManifestAgent() [3/3]

ManifestAgent ( std::string const &  libraryName,
std::vector< ClassProxy > const &  classes 
)

Set the library name and calls addClasses() for the given classes.

Member Function Documentation

◆ setLibraryVersion()

void setLibraryVersion ( int  major,
int  minor,
int  patch 
)

Set version of library.

◆ addClasses()

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.

◆ loadFile()

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.

◆ saveToFile()

void saveToFile ( Path const &  filePath)

Serialize the mClasses vector to the given file.

◆ finalize()

void finalize ( )

Register the parent - child relationships of the previously loaded files.

◆ reflect()

void reflect ( Reflector &  r)
inline

Member Data Documentation

◆ mClasses

std::vector< ManifestClassInfo > mClasses
protected

◆ mLibraryName

std::string mLibraryName
protected

◆ mVersion

LibraryVersion mVersion
protected

The documentation for this class was generated from the following file: