MIRA
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ConfigurationLoaderPlugin Class Referenceabstract

Base class for loader plugins. More...

#include <loader/Loader.h>

Inheritance diagram for ConfigurationLoaderPlugin:
Inheritance graph
[legend]

Public Member Functions

virtual ~ConfigurationLoaderPlugin ()
 
virtual void startDocument (ConfigurationLoader *ioLoader)
 Is called when a new document is parsed. More...
 
virtual void endDocument (ConfigurationLoader *ioLoader)
 Is called after the whole document was parsed. More...
 
virtual void parseNode (const XMLDom::const_iterator &node, ConfigurationLoader *ioLoader)=0
 Is called whenever a XML tag is found that this loader supports. More...
 
Class const & getClass () const
 call the virtual internalGetClass(). More...
 

Static Public Member Functions

static PseudoClass const & CLASS ()
 

Protected Member Functions

virtual Class const & internalGetClass () const =0
 

Detailed Description

Base class for loader plugins.

Loader plugins are used to interpret single XML tags in a configuration file.

The Framework queries all available plugin types from the ClassFactory at startup and registers them at the ConfigurationLoader.

On registration, the ConfigurationLoader inspects each plugin for the configuration tags it handles and whether it needs to be informed of document start/end. In order to avoid the unconditional need for instantiation, these properties are specified through the plugin's object meta data registered with the ClassFactory using MIRA_META_OBJECT. The loader reads the following properties:

Examples:

MIRA_META_OBJECT(NamespaceLoader,
("Tag", "namespace")
("StartEndDocument", "true"))
MIRA_META_OBJECT(InitialWorkspaceLoader,
("Tag0", "initial-workspace")
("Tag1", "initial_workspace")
("AlwaysInstantiate", "true"))

Each plugin is instantiated (by each loader) once at most, and then stored and used from that point onward. If neither StartEndDocument nor AlwaysInstantiate is true, the plugin is only instantiated when a respective tag is actually read in the configuration.

Constructor & Destructor Documentation

◆ ~ConfigurationLoaderPlugin()

virtual ~ConfigurationLoaderPlugin ( )
inlinevirtual

Member Function Documentation

◆ startDocument()

virtual void startDocument ( ConfigurationLoader ioLoader)
inlinevirtual

Is called when a new document is parsed.

Can be used for reset and initialization, or for setting default values to the loaders context.

Parameters
[in,out]ioLoaderThe loader that called us. Can be used to modify the context of the loader.

◆ endDocument()

virtual void endDocument ( ConfigurationLoader ioLoader)
inlinevirtual

Is called after the whole document was parsed.

Can be used to invoke the parsed content or for clean up.

Parameters
[in,out]ioLoaderThe loader that called us.

◆ parseNode()

virtual void parseNode ( const XMLDom::const_iterator node,
ConfigurationLoader ioLoader 
)
pure virtual

Is called whenever a XML tag is found that this loader supports.

Parameters
[in]nodeThe node containing the XML tag.
[in,out]ioLoaderThe loader that called us. Can be used to modify the context of the loader.

◆ getClass()

Class const& getClass ( ) const
inlineinherited

call the virtual internalGetClass().

◆ CLASS()

static PseudoClass const& CLASS ( )
inlinestaticinherited

◆ internalGetClass()

virtual Class const& internalGetClass ( ) const
protectedpure virtualinherited

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