State Class Reference

#include <State.h>

Collaboration diagram for State:

[legend]
List of all members.

Public Member Functions

 State ()
 State (string n)
 State (const State &s)
Stateoperator= (const State &s)
 ~State ()
void setName (string n)
void setComment (string c)
void setLdaVersion (Version *v)
void setDccVersion (Version *v)
void setDifVersion (Version *v)
void setAsicVersion (Version *v)
string getName ()
VersiongetLdaVersion ()
VersiongetDccVersion ()
VersiongetDifVersion ()
VersiongetAsicVersion ()
bool isLocked ()
void upload () throw (ILCException::Exception)
vector< int > getDifIDs ()
vector< int > getAsicIDs ()
vector< int > getDccIDs ()
vector< string > getLdaIDs ()
vector< int > getUsedDifIDs ()
vector< int > getUsedDccIDs ()
vector< string > getUsedLdaIDs ()
vector< string > getUsedLdaByDccIDs ()
vector< string > getUsedLdaChannelByDif ()
vector< string > getUsedLdaChannelByDcc ()
LdaConfigurationgetLdaConfiguration () throw (ILCException::Exception)
DccConfigurationgetDccConfiguration () throw (ILCException::Exception)
DifConfigurationgetDifConfiguration () throw (ILCException::Exception)
AsicConfigurationgetAsicConfiguration () throw (ILCException::Exception)
void lock ()
vector< State * > getStates ()
Stateclone ()
void recursiveUpload ()
bool stateExist (string n)
bool toBeUpdated ()
void saveToXML (string fileName)
string checkLdaParams (string params) throw (ILCException::Exception)
string checkDccParams (string params) throw (ILCException::Exception)
string checkDifParams (string difType, string params) throw (ILCException::Exception)
string checkAsicParams (string asicType, string params) throw (ILCException::Exception)

Static Public Member Functions

static Statedownload (string n) throw (ILCException::Exception)
static vector< string > getUnusedStateNames () throw (ILCException::Exception)
static void deleteState (string n) throw (ILCException::Exception)
static StatecreateStateFromXML (string stateName, string fileName)

Detailed Description

Class Managing a State


Constructor & Destructor Documentation

State::State (  ) 

Constructor

State::State ( string  n  ) 

Constructor

Parameters:
n The name of the state

State::State ( const State s  ) 

Copy Constructor

State::~State (  ) 

Destructor


Member Function Documentation

string State::checkAsicParams ( string  asicType,
string  params 
) throw (ILCException::Exception)

Get the values of the given parameters in the current state

Parameters:
asicType The type of ASIC
params A String containing the list of parameters separated with a coma (ex : 'FIRMWARE, HARDWARE')
Returns:
A string containing the values of the parameters + the number of ASIC having such values

string State::checkDccParams ( string  params  )  throw (ILCException::Exception)

Get the values of the given parameters in the current state

Parameters:
params A String containing the list of parameters separated with a coma (ex : 'FIRMWARE, HARDWARE')
Returns:
A string containing the values of the parameters + the number of DCC having such values

string State::checkDifParams ( string  difType,
string  params 
) throw (ILCException::Exception)

Get the values of the given parameters in the current state

Parameters:
difType The type of DIF
params A String containing the list of parameters separated with a coma (ex : 'FIRMWARE, HARDWARE')
Returns:
A string containing the values of the parameters + the number of DIF having such values

string State::checkLdaParams ( string  params  )  throw (ILCException::Exception)

Get the values of the given parameters in the current state

Parameters:
params A String containing the list of parameters separated with a coma (ex : 'FIRMWARE, HARDWARE')
Returns:
A string containing the values of the parameters + the number of LDA having such values

State * State::clone (  ) 

Return a new State which is a copy of the current one

State * State::createStateFromXML ( string  stateName,
string  fileName 
) [static]

Create a State from a XML file. Configurations contained in the file will be uploaded to the database. If an object is not concerned (ex: no LDA in the XML file) then nothing is done for this object (no LDA configuration defined for the State). This method does not upload the State to the database.

Parameters:
stateName The name of the created State
fileName The name of the XML file containing the configuration
Returns:
The new State (you have to delete the pointer yourself)

void State::deleteState ( string  n  )  throw (ILCException::Exception) [static]

Delete a state from the database. Throws an Exception if the state does not exist or is used in a setup.

Parameters:
n The name of the state

State * State::download ( string  n  )  throw (ILCException::Exception) [static]

Download a state from the database. May throw Exception.

Parameters:
n The name of the state to download
Returns:
A State object containing all the informations from the database (you have to delete it!).

AsicConfiguration * State::getAsicConfiguration (  )  throw (ILCException::Exception)

Download the ASIC Configuration associated with the current state from the database. May throw Exception

Returns:
A AsicConfiguration pointer. This pointer will be automaticaly deleted in the State destructor.

Version * State::getAsicVersion (  ) 

Get the ASIC version of the state

Returns:
A clone of the Version object (you must free the returned pointer once used!)

DccConfiguration * State::getDccConfiguration (  )  throw (ILCException::Exception)

Download the DCC Configuration associated with the current state from the database. May throw Exception

Returns:
A DccConfiguration pointer. This pointer will be automaticaly deleted in the State destructor.

Version * State::getDccVersion (  ) 

Get the DCC version of the state

Returns:
A clone of the Version object (you must free the returned pointer once used!)

DifConfiguration * State::getDifConfiguration (  )  throw (ILCException::Exception)

Download the DIF Configuration associated with the current state from the database. May throw Exception

Returns:
A DifConfiguration pointer. This pointer will be automaticaly deleted in the State destructor.

Version * State::getDifVersion (  ) 

Get the DIF version of the state

Returns:
A clone of the Version object (you must free the returned pointer once used!)

LdaConfiguration * State::getLdaConfiguration (  )  throw (ILCException::Exception)

Download the LDA Configuration associated with the current state from the database. May throw Exception

Returns:
A LdaConfiguration pointer. This pointer will be automaticaly deleted in the State destructor.

Version * State::getLdaVersion (  ) 

Get the LDA version of the state

Returns:
A clone of the Version object (you must free the returned pointer once used!)

vector< State * > State::getStates (  ) 

Retrieve all the existing states in the database

Returns:
A vector containing all the existing states in the database. You have to delete all this pointers!

vector< string > State::getUnusedStateNames (  )  throw (ILCException::Exception) [static]

Retrieve the names of the states not used in a setup

Returns:
A vector of setup's name

void State::lock (  ) 

Lock the state so that no further modification can be made.

void State::recursiveUpload (  ) 

Check if the 4 objects Configurations have been modified (modified flag), upload a new version for each modified configuration and creates a new State with the new versions. The name of the state is incremented (TOTO->TOTO_1, TOTO_1->TOTO_2).

void State::saveToXML ( string  fileName  ) 

Export the configuration to a XML file

Parameters:
fileName The name of the file to write the configuration (should not exist before the call).

void State::setAsicVersion ( Version v  ) 

Change the ASIC version of the state (the parameter is cloned!) Previously downloaded AsicConfigurations are set to NULL!

Parameters:
v The new version

void State::setComment ( string  c  ) 

Change the comment of the state

Parameters:
n The new comment

void State::setDccVersion ( Version v  ) 

Change the DCC version of the state (the parameter is cloned!) Previously downloaded DccConfigurations are set to NULL!

Parameters:
v The new version

void State::setDifVersion ( Version v  ) 

Change the DIF version of the state (the parameter is cloned!) Previously downloaded DifConfigurations are set to NULL!

Parameters:
v The new version

void State::setLdaVersion ( Version v  ) 

Change the LDA version of the state (the parameter is cloned!) Previously downloaded LdaConfigurations are set to NULL!

Parameters:
v The new version

void State::setName ( string  n  ) 

Change the name of the state

Parameters:
n The new name

bool State::stateExist ( string  n  ) 

Check if the state does exist

Parameters:
n The name of the state
Returns:
True if the state already exists in the DB

bool State::toBeUpdated (  ) 

Check if the state has been modified

void State::upload (  )  throw (ILCException::Exception)

Check the validity of the state and upload it to the database. May throw Exception.


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