Configuration Class Reference

#include <Configuration.h>

Inheritance diagram for Configuration:

[legend]
List of all members.

Public Member Functions

void add (ConfigObject *l)
vector< ConfigObject * > & getVector ()
int size ()
void clear ()
virtual void download (int maj, int min)=0
virtual Versionupload (string n) const =0
virtual Versionupload (int maj, string n) const =0
virtual Versionupload (int maj, int min) const =0
virtual void addFromXML (string fileName)=0
void setModified (bool b)
bool isModified ()
bool minorUpdateNeeded ()
vector< string > toXML ()
void saveToXML (string fileName)

Static Public Member Functions

static vector< Version * > getVersions (string objectName) throw (ILCException::Exception)
static VersiongetVersion (string objectName, int majorId, int minorId) throw (ILCException::Exception)
static bool versionExist (string objectName, string n) throw (ILCException::Exception)

Protected Member Functions

VersioncreateMajorVersion (string n) const throw (ILCException::Exception)
VersioncreateMinorVersion (int m, string n) const throw (ILCException::Exception)
vector< map< string, string > > parse (string fileName) throw (ILCException::Exception)

Static Protected Member Functions

static vector< Version * > getUnusedVersions (string object_name) throw (ILCException::Exception)

Protected Attributes

string objectName
vector< ConfigObject * > list
bool modified

Detailed Description

Abstract super class for configuration


Member Function Documentation

void Configuration::add ( ConfigObject l  ) 

Add an object to the configuration

Parameters:
l A pointer to the object to add

virtual void Configuration::addFromXML ( string  fileName  )  [pure virtual]

Parse a XML file and add the objects to the configuration

Implemented in AsicConfiguration, DccConfiguration, DifConfiguration, and LdaConfiguration.

void Configuration::clear (  ) 

Delete all contained objects and clear the vector of objects

virtual void Configuration::download ( int  maj,
int  min 
) [pure virtual]

Load the given version

Parameters:
maj The majorVersionID
min The MinorVersionID

Implemented in AsicConfiguration, DccConfiguration, DifConfiguration, and LdaConfiguration.

vector< Version * > Configuration::getUnusedVersions ( string  object_name  )  throw (ILCException::Exception) [static, protected]

Get the list of unused versions

Parameters:
object_name The name of the configured object
Returns:
A vector containing all the unused versions. Once used, you should free the memory using the Version::clearVersionVector(vector<Version*> v) method.

vector< ConfigObject * > & Configuration::getVector (  ) 

Get the vector actualy containing the configurations

Returns:
A vector containing all the configured objects (they are NOT clones!)

Version * Configuration::getVersion ( string  objectName,
int  majorId,
int  minorId 
) throw (ILCException::Exception) [static]

Get an existing versions

Parameters:
objectName Name of the object for which you want the existing version (LDA, DCC, DIF, ASIC, ...)
majorId The version major ID
minorId The version minor ID
Returns:
A pointer on a Version. Once used, you should free the memory with a delete on the pointer.

vector< Version * > Configuration::getVersions ( string  objectName  )  throw (ILCException::Exception) [static]

Get all existing versions

Parameters:
objectName Name of the object for which you want the existing versions (can be LDA, DCC, DIF, ...)
Returns:
A vector containing all the existing versions. Once used, you should free the memory using the Version::clearVersionVector(vector<Version*> v) method.

bool Configuration::isModified (  ) 

Check the modified flag

Returns:
True if the configuration was flaged as modified

bool Configuration::minorUpdateNeeded (  ) 

Check if one of the objects was flagged as modified -> the user is preparing a minor update

vector< map< string, string > > Configuration::parse ( string  fileName  )  throw (ILCException::Exception) [protected]

Parse a XML file to create a configuration

void Configuration::saveToXML ( string  fileName  ) 

Export the configuration to a XML file

Parameters:
fileName The name of the file to write the configuration. If the file exists, the configuration is appended to the end. If the file does not exist, it is created.

void Configuration::setModified ( bool  b  ) 

Flag the configuration as modified -> a new version configuration will be created in case of recursive upload of the containing state

Parameters:
b True if the configuration was modified

int Configuration::size (  ) 

Return the number of objects in the configuration

vector< string > Configuration::toXML (  ) 

Get a XML version of the configuration

Returns:
A vector<string> containing one XML description per object

virtual Version* Configuration::upload ( int  maj,
int  min 
) const [pure virtual]

NOT IMPLEMENTED YET!! Update an existing configuration version with the current configuration. The version must not be locked!

Parameters:
maj The ID of the Major Version
min The ID of the Minor Version
Returns:
A pointer on a Version object describing the uploaded version (you have to delete this object afterward)

Implemented in AsicConfiguration, DccConfiguration, DifConfiguration, and LdaConfiguration.

virtual Version* Configuration::upload ( int  maj,
string  n 
) const [pure virtual]

Create a new Minor version with the current configuration.

Parameters:
maj The ID of the Major version in which you want to create a minor version
n The name of the new version
Returns:
A pointer on a Version object describing the uploaded version (you have to delete this object afterward)

Implemented in AsicConfiguration, DccConfiguration, DifConfiguration, and LdaConfiguration.

virtual Version* Configuration::upload ( string  n  )  const [pure virtual]

Create a new Major version with the current configuration.

Parameters:
n The name of the new version
Returns:
A pointer on a Version object describing the uploaded version (you have to delete this object afterward)

Implemented in AsicConfiguration, DccConfiguration, DifConfiguration, and LdaConfiguration.

bool Configuration::versionExist ( string  objectName,
string  n 
) throw (ILCException::Exception) [static]

Check if the version name is alreasy used

Parameters:
objectName Name of the object for which you want the existing version (LDA, DCC, DIF, ASIC, ...)
n The name of the version
Returns:
True if the name is already used by a version


The documentation for this class was generated from the following files:
Generated on Tue Feb 28 15:35:34 2012 for ILCConfigurationDB by  doxygen 1.4.7