int stringToInteger(const std::string& theInt);
bool stringToBoolean(const std::string& theInt);
-Config_Properties Config_PropManager::myProps;
+Config_Properties& Config_PropManager::props() {
+ static Config_Properties* confProps = new Config_Properties();
+ return *confProps;
+}
Config_Prop* Config_PropManager::registerProp(const std::string& theSection,
else {
aProp =
new Config_Prop(theSection, theName, theTitle, theType, theDefaultValue, theMin, theMax);
- myProps.push_back(aProp);
+ props().push_back(aProp);
}
return aProp;
}
Config_Prop* Config_PropManager::findProp(const std::string& theSection, const std::string& theName)
{
Config_Properties::const_iterator aIt;
- for (aIt = myProps.cbegin(); aIt != myProps.cend(); ++aIt) {
+ Config_Properties aProps = props();
+ for (aIt = aProps.cbegin(); aIt != aProps.cend(); ++aIt) {
Config_Prop* aProp = (*aIt);
if ((aProp->section() == theSection) && (aProp->name() == theName))
return aProp;
{
Config_Properties aRes;
Config_Properties::const_iterator aIt;
- for (aIt = myProps.cbegin(); aIt != myProps.cend(); aIt++) {
+ Config_Properties aProps = props();
+ for (aIt = aProps.cbegin(); aIt != aProps.cend(); aIt++) {
Config_Prop* aProp = (*aIt);
if (aProp->type() != Config_Prop::Disabled)
aRes.push_back(aProp);
// Return only non disabled sections
std::list<std::string> aSections;
Config_Properties::const_iterator aIt;
- for (aIt = myProps.cbegin(); aIt != myProps.cend(); aIt++) {
+ Config_Properties aProps = props();
+ for (aIt = aProps.cbegin(); aIt != aProps.cend(); aIt++) {
const Config_Prop* aProp = (*aIt);
if (aProp->type() != Config_Prop::Disabled)
aSections.push_back(aProp->section());
{
Config_Properties aRes;
Config_Properties::iterator aIt;
- for (aIt = myProps.begin(); aIt != myProps.end(); aIt++) {
+ Config_Properties aProps = props();
+ for (aIt = aProps.begin(); aIt != aProps.end(); aIt++) {
Config_Prop* aProp = (*aIt);
if ((aProp->section() == theSection) && (aProp->type() != Config_Prop::Disabled))
aRes.push_back(aProp);