SFrame 3.6
SCycleBaseConfig Class Reference

Base class for reading the XML configuration. More...

#include <core/include/SCycleBaseConfig.h>

Inheritance diagram for SCycleBaseConfig:
Collaboration diagram for SCycleBaseConfig:

List of all members.

Public Member Functions

 SCycleBaseConfig ()
 Default constructor.
void Initialize (TXMLNode *) throw ( SError )
 Function initialising the cycle.
const SCycleConfigGetConfig () const
 Get the overall cycle configuration object.
SCycleConfigGetConfig ()
 Get the overall cycle configuration object.
virtual void SetConfig (const SCycleConfig &config)
 Set the overall cycle configuration.
virtual const TList & GetConfigurationObjects () const
 Get the list of all declared configuration objects.
virtual void SetConfInput (TList *input)
 Set which list should be used for the configuration input.
virtual TList * GetConfInput () const
 Check which list should be used for the configuration input.
void DeclareProperty (const std::string &name, std::string &value)
 Declare a std::string property.
void DeclareProperty (const std::string &name, int &value)
 Declare an int property.
void DeclareProperty (const std::string &name, double &value)
 Declare a double property.
void DeclareProperty (const std::string &name, bool &value)
 Declare a bool property.
void DeclareProperty (const std::string &name, std::vector< std::string > &value)
 Declare a std::vector<std::string> property.
void DeclareProperty (const std::string &name, std::vector< int > &value)
 Declare a std::vector<int> property.
void DeclareProperty (const std::string &name, std::vector< double > &value)
 Declare a std::vector<double> property.
void DeclareProperty (const std::string &name, std::vector< bool > &value)
 Declare a std::vector<bool> property.
void AddConfigObject (TObject *object)
 Add a configuration object that should be available on the PROOF nodes.
TObject * GetConfigObject (const char *name) const
 Get a configuration object on the PROOF nodes.

Protected Member Functions

virtual SInputData InitializeInputData (TXMLNode *) throw ( SError )
 Function that reads an InputData definition.
virtual void InitializeUserConfig (TXMLNode *) throw ( SError )
 Function that reads the user properties from the XML.
void SetProperty (const std::string &name, const std::string &value) throw ( SError )
 Internal function for setting a property value.
std::string DecodeEnvVar (const std::string &value) const
 Function for decoding a shell environment variable.

Protected Attributes

SCycleConfig m_config
 The cycle configuration:

Detailed Description

Base class for reading the XML configuration.

This part of the SCycleBase class is responsible for handling the configuration of the cycle. It can read the cycle's part of the configuration XML, it handles the properties of the cycle and it provides all these information for the "higher level" parts of the SCycleBase code.

Version:
Revision:
331

Definition at line 47 of file SCycleBaseConfig.h.


Constructor & Destructor Documentation

SCycleBaseConfig::SCycleBaseConfig ( )

Default constructor.

The constructor only initialises the base class.

Definition at line 87 of file SCycleBaseConfig.cxx.

References REPORT_VERBOSE.


Member Function Documentation

void SCycleBaseConfig::AddConfigObject ( TObject *  object)

Add a configuration object that should be available on the PROOF nodes.

Definition at line 404 of file SCycleBaseConfig.cxx.

void SCycleBaseConfig::DeclareProperty ( const std::string &  name,
std::string &  value 
)

Declare a std::string property.

Use this function in the constructor of your analysis cycle to declare an std::string object as a property to be set up by the framework according to the configuration set in the XML file.

Parameters:
nameThe name under which the property appears in XML
valueThe std::string object that you use as the property

Definition at line 250 of file SCycleBaseConfig.cxx.

References CHECK_FOR_DUPLICATES.

void SCycleBaseConfig::DeclareProperty ( const std::string &  name,
int &  value 
)

Declare an int property.

Use this function in the constructor of your analysis cycle to declare an int variable as a property to be set up by the framework according to the configuration set in the XML file.

Parameters:
nameThe name under which the property appears in XML
valueThe int variable that you use as the property

Definition at line 269 of file SCycleBaseConfig.cxx.

References CHECK_FOR_DUPLICATES.

void SCycleBaseConfig::DeclareProperty ( const std::string &  name,
double &  value 
)

Declare a double property.

Use this function in the constructor of your analysis cycle to declare a double variable as a property to be set up by the framework according to the configuration set in the XML file.

Parameters:
nameThe name under which the property appears in XML
valueThe double variable that you use as the property

Definition at line 287 of file SCycleBaseConfig.cxx.

References CHECK_FOR_DUPLICATES.

void SCycleBaseConfig::DeclareProperty ( const std::string &  name,
bool &  value 
)

Declare a bool property.

Use this function in the constructor of your analysis cycle to declare a bool variable as a property to be set up by the framework according to the configuration set in the XML file. The boolean property can be specified in a number of ways. Either with the (case insensitive) "true" and "false" words, or with the 0 (false) and 1 (true) numbers. (Actually all non-zero numbers are translated as "true".)

Parameters:
nameThe name under which the property appears in XML
valueThe bool variable that you use as the property

Definition at line 310 of file SCycleBaseConfig.cxx.

References CHECK_FOR_DUPLICATES.

void SCycleBaseConfig::DeclareProperty ( const std::string &  name,
std::vector< std::string > &  value 
)

Declare a std::vector<std::string> property.

Use this function in the constructor of your analysis cycle to declare a vector of std::string objects as a property to be set up by the framework according to the configuration set in the XML file. The strings have to be put as a space separated list in the XML.

Parameters:
nameThe name under which the property appears in XML
valueThe object that you use as the property

Definition at line 329 of file SCycleBaseConfig.cxx.

References CHECK_FOR_DUPLICATES.

void SCycleBaseConfig::DeclareProperty ( const std::string &  name,
std::vector< int > &  value 
)

Declare a std::vector<int> property.

Use this function in the constructor of your analysis cycle to declare a vector of int variables as a property to be set up by the framework according to the configuration set in the XML file. Ints have to be put as a space separated list in the XML.

Parameters:
nameThe name under which the property appears in XML
valueThe object that you use as the property

Definition at line 349 of file SCycleBaseConfig.cxx.

References CHECK_FOR_DUPLICATES.

void SCycleBaseConfig::DeclareProperty ( const std::string &  name,
std::vector< double > &  value 
)

Declare a std::vector<double> property.

Use this function in the constructor of your analysis cycle to declare a vector of double variables as a property to be set up by the framework according to the configuration set in the XML file. Doubles have to be put as a space separated list in the XML.

Parameters:
nameThe name under which the property appears in XML
valueThe object that you use as the property

Definition at line 369 of file SCycleBaseConfig.cxx.

References CHECK_FOR_DUPLICATES.

void SCycleBaseConfig::DeclareProperty ( const std::string &  name,
std::vector< bool > &  value 
)

Declare a std::vector<bool> property.

Use this function in the constructor of your analysis cycle to declare a vector of bool variables as a property to be set up by the framework according to the configuration set in the XML file. Bools have to be put as a space separated list in the XML. A boolean property can be specified in a number of ways. Either with the (case insensitive) "true" and "false" words, or with the 0 (false) and 1 (true) numbers. (Actually all non-zero numbers are translated as "true".) They can be freely mixed.

Parameters:
nameThe name under which the property appears in XML
valueThe object that you use as the property

Definition at line 393 of file SCycleBaseConfig.cxx.

References CHECK_FOR_DUPLICATES.

std::string SCycleBaseConfig::DecodeEnvVar ( const std::string &  value) const [protected]

Function for decoding a shell environment variable.

This function simply uses TSystem to do the environment variable expansion in path names. One can use either "$SOMETHING" or "$(SOMETHING)" in the path names. (The latter is also Win32 compatible, not that it matters for SFrame...)

Note that now the expansion is only done if the property begins with ":exp:". If it does, then these 5 characters are removed from the beginning of the string, and the rest of the string is given to TSystem for expansion.

Parameters:
valueThe property that you want expanded based on the environment settings
Returns:
The path name that was expanded to be a real file name

Definition at line 749 of file SCycleBaseConfig.cxx.

References REPORT_ERROR.

const SCycleConfig & SCycleBaseConfig::GetConfig ( ) const [virtual]

Get the overall cycle configuration object.

Implements ISCycleBaseConfig.

Definition at line 187 of file SCycleBaseConfig.cxx.

References m_config.

SCycleConfig & SCycleBaseConfig::GetConfig ( ) [virtual]

Get the overall cycle configuration object.

Implements ISCycleBaseConfig.

Definition at line 192 of file SCycleBaseConfig.cxx.

References m_config.

TObject * SCycleBaseConfig::GetConfigObject ( const char *  name) const

Get a configuration object on the PROOF nodes.

Definition at line 410 of file SCycleBaseConfig.cxx.

const TList & SCycleBaseConfig::GetConfigurationObjects ( ) const [virtual]

Get the list of all declared configuration objects.

Implements ISCycleBaseConfig.

Definition at line 219 of file SCycleBaseConfig.cxx.

TList * SCycleBaseConfig::GetConfInput ( ) const [virtual]

Check which list should be used for the configuration input.

Implements ISCycleBaseConfig.

Definition at line 230 of file SCycleBaseConfig.cxx.

void SCycleBaseConfig::Initialize ( TXMLNode *  node) throw ( SError ) [virtual]

Function initialising the cycle.

Basically everything about an analysis in SFrame is set up through a main XML configuration file that describes the given analysis. This function is called by the framework to initialise the cycle based on the part of the XML that describes it.

It should generally not be called by the user.

Parameters:
nodeThe top XML node describing the cycle

Implements ISCycleBaseConfig.

Definition at line 103 of file SCycleBaseConfig.cxx.

References SLogger::endmsg(), INFO, SCycleConfig::LOCAL, SCycleConfig::PROOF, REPORT_VERBOSE, and WARNING.

void SCycleBaseConfig::InitializeUserConfig ( TXMLNode *  node) throw ( SError ) [protected, virtual]

Function that reads the user properties from the XML.

Definition at line 605 of file SCycleBaseConfig.cxx.

References DEBUG, SLogger::endmsg(), and REPORT_VERBOSE.

void SCycleBaseConfig::SetConfig ( const SCycleConfig config) [virtual]

Set the overall cycle configuration.

Implements ISCycleBaseConfig.

Definition at line 197 of file SCycleBaseConfig.cxx.

References SCycleConfig::GetProperties(), m_config, and SetProperty().

void SCycleBaseConfig::SetConfInput ( TList *  input) [virtual]

Set which list should be used for the configuration input.

Implements ISCycleBaseConfig.

Definition at line 224 of file SCycleBaseConfig.cxx.

void SCycleBaseConfig::SetProperty ( const std::string &  name,
const std::string &  value 
) throw ( SError ) [protected]

Internal function for setting a property value.

Definition at line 656 of file SCycleBaseConfig.cxx.

References SLogger::endmsg(), and WARNING.

Referenced by SetConfig().


Member Data Documentation

The cycle configuration:

Definition at line 108 of file SCycleBaseConfig.h.

Referenced by GetConfig(), and SetConfig().


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