47 #ifndef _MIRA_LOADER_H_ 48 #define _MIRA_LOADER_H_ 51 #include <boost/filesystem/path.hpp> 52 #include <boost/filesystem/operations.hpp> 53 #include <boost/assign.hpp> 64 class ConfigurationLoader;
182 typedef std::map<std::string, std::string>
Context;
248 struct CompareConfigurationPreparePlugin {
251 return a->getOrder() < b->getOrder();
259 CompareConfigurationPreparePlugin> PreparePluginMap;
261 typedef std::vector<std::pair<ClassProxy, ConfigurationLoaderPluginPtr>> LoaderPluginSet;
262 typedef std::map<std::string, LoaderPluginSet> LoaderPluginMap;
264 bool mEnableUnknownTagWarnings;
267 PreparePluginMap mPreparePlugins;
270 LoaderPluginMap mLoaderPluginsMap;
271 LoaderPluginSet mLoaderPlugins;
273 bool mAddedInfoToException;
void registerPreparePlugin(ConfigurationPreparePluginPtr plugin)
Register a prepare plugin.
A STL conform DOM reader/writer for XML.
A STL conform wrapper for libxml2 to read XML files as DOM.
Definition: XMLDom.h:74
boost::shared_ptr< ConfigurationLoaderPlugin > ConfigurationLoaderPluginPtr
typedef for ConfigurationLoaderPlugin pointer
Definition: Loader.h:171
Base class for loader plugins.
Definition: Loader.h:138
ConfigurationLoader(bool unknownTagWarning=true)
The constructor.
The class proxy assures that the pointer to the class object is always valid.
Definition: Class.h:400
virtual ~ConfigurationLoaderPlugin()
Definition: Loader.h:142
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
void registerLoaderPlugin(const ClassProxy &plugin)
Register a loader plugin.
void load(const XMLDom &xml)
Load/interpret the document.
Const sibling_iterator for iterating over xml nodes that have the same parent (siblings) ...
Definition: XMLDom.h:763
#define MIRA_ABSTRACT_OBJECT(classIdentifier)
Use this MACRO instead of MIRA_OBJECT to declare the class as abstract.
Definition: FactoryMacros.h:235
Base class for prepare plugins.
Definition: Loader.h:71
$Header file containing base classes to enable class creation using a class factory$ ...
virtual void parseNode(const XMLDom::const_iterator &node, ConfigurationLoader *ioLoader)=0
Is called whenever a XML tag is found that this loader supports.
boost::shared_ptr< ConfigurationPreparePlugin > ConfigurationPreparePluginPtr
typedef for ConfigurationPreparePlugin pointer
Definition: Loader.h:94
The object class acts as a generic base class for classes which should be used with the classFactory...
Definition: Object.h:144
Context & getContext()
Get the context of the loader.
Definition: Loader.h:228
std::map< std::string, std::string > Context
Definition: Loader.h:182
void prepare(XMLDom &ioXML)
Prepare the document.
virtual void startDocument(ConfigurationLoader *ioLoader)
Is called when a new document is parsed.
Definition: Loader.h:151
virtual void endDocument(ConfigurationLoader *ioLoader)
Is called after the whole document was parsed.
Definition: Loader.h:158
virtual void prepareDocument(XMLDom &xml)=0
Called by the loader of the configuration file.
Class for loading, parsing, modifying and interpreting application configuration files.
Definition: Loader.h:179
virtual ~ConfigurationPreparePlugin()
Definition: Loader.h:75
virtual int getOrder() const =0
Derived classes must return an order for their prepare plugin.