ConfigProcessor Class Reference

ConfigProcessor class. More...

#include <ConfigProcessor.h>

List of all members.

Public Types

 LOAD
 SAVE
enum  IOMode { LOAD, SAVE }
 Possible I/O modes for the processor. More...

Public Member Functions

 ConfigProcessor (string fileName, IOMode io)
 Constructor of this class.
 ~ConfigProcessor ()
 Destructor of this class.
string GetCurrentProcessedFileName () const
 Returns name of the file currently being processed.
ConfigApplicationGetConfigApplication ()
 Loads configuration of application from the file.
ConfigCanvasGetConfigCanvas ()
 Loads configuration of canvas from the file.
ConfigMatrixGetConfigMatrix ()
 Loads configuration of matrix from the file.
Object::ConfigGetConfigObject ()
 Loads configuration of the object from the file.
void SaveConfig (const BaseConfig &config)
 Saves configuration to the file.

Static Public Member Functions

static FactoryObjectConfigsDeclar::ProductTypeCreateObjectConfig (const FactoryObjectConfigsDeclar::IdentifierType &name, const FactoryObjectConfigsDeclar::InitializerType &initializer)
 According to the name value creates new object's config of that type on the heap passing to its constructor FactoryObjectConfigsDeclar::InitializerType parameter.

Private Attributes

TiXmlDocument xmlFileTiny
 TinyXML class for parsing XML documents.
string xmlFileName
 Name of the file currently being processed.
IOMode mode
 I/O mode the processor is in.
TiXmlElement * element
 Root element processor is currently working with.
TiXmlHandle hRoot
 Handler to the root "agents2007" element.


Detailed Description

ConfigProcessor class.

Use this class for reading/writing configuration info from/to file. Every loading function of this class throws ExceptionConfigBadFile when incompatible file (config) is detected. Every function throws ExceptionConfigBadMode when they are called in bad mode.


Member Enumeration Documentation

enum ConfigProcessor::IOMode

Possible I/O modes for the processor.

Enumerator:
LOAD 
SAVE 


Constructor & Destructor Documentation

ConfigProcessor::ConfigProcessor ( string  fileName,
IOMode  io 
)

Constructor of this class.

Parameters:
fileName Name of the file with the configuration.
io I/O mode for the Processor

ConfigProcessor::~ConfigProcessor (  ) 

Destructor of this class.


Member Function Documentation

static FactoryObjectConfigsDeclar::ProductType* ConfigProcessor::CreateObjectConfig ( const FactoryObjectConfigsDeclar::IdentifierType name,
const FactoryObjectConfigsDeclar::InitializerType initializer 
) [inline, static]

According to the name value creates new object's config of that type on the heap passing to its constructor FactoryObjectConfigsDeclar::InitializerType parameter.

Parameters:
name Name of the object
initializer Argument for constructor of the new object
WARNING! You have to take care of deleting the object.

ConfigApplication * ConfigProcessor::GetConfigApplication (  ) 

Loads configuration of application from the file.

The config is allocated on heap and has to be explicitly deleted!

ConfigCanvas * ConfigProcessor::GetConfigCanvas (  ) 

Loads configuration of canvas from the file.

The config is allocated on heap and has to be explicitly deleted!

ConfigMatrix * ConfigProcessor::GetConfigMatrix (  ) 

Loads configuration of matrix from the file.

The config is allocated on heap and has to be explicitly deleted!

Object::Config * ConfigProcessor::GetConfigObject (  ) 

Loads configuration of the object from the file.

The config is allocated on heap and has to be explicitly fdeleted!

string ConfigProcessor::GetCurrentProcessedFileName (  )  const [inline]

Returns name of the file currently being processed.

void ConfigProcessor::SaveConfig ( const BaseConfig config  ) 

Saves configuration to the file.

Parameters:
config Config with the settings to be saved.


Member Data Documentation

TiXmlElement* ConfigProcessor::element [private]

Root element processor is currently working with.

TiXmlHandle ConfigProcessor::hRoot [private]

Handler to the root "agents2007" element.

IOMode ConfigProcessor::mode [private]

I/O mode the processor is in.

string ConfigProcessor::xmlFileName [private]

Name of the file currently being processed.

TiXmlDocument ConfigProcessor::xmlFileTiny [private]

TinyXML class for parsing XML documents.


The documentation for this class was generated from the following files:
Generated on Sun Apr 29 11:46:11 2007 for IPP/ICP2007 by  doxygen 1.4.7