예제 #1
0
 bool CFGManager::setProperty(const cfgPropertyStruct &_propertyS) {
   utils::MutexLocker locker(&mutexCFGParams);
   CFGParam *param = NULL;
   CFGProperty property;
   property.setParamId(_propertyS.paramId);
   property.setPropertyIndex(_propertyS.propertyIndex);
   property.setPropertyType(_propertyS.propertyType);
   switch (_propertyS.propertyType) {
   case boolProperty:
     property.setValue(_propertyS.bValue);
     break;
   case doubleProperty:
     property.setValue(_propertyS.dValue);
     break;
   case intProperty:
     property.setValue(_propertyS.iValue);
     break;
   case stringProperty:
     property.setValue(_propertyS.sValue);
     break;
   default:
     return false;
   } // switch
   if( getParam(&param, _propertyS.paramId) ) {
     return param->setProperty(property);
   } else {
     return false;
   }
 }
예제 #2
0
 bool CFGManager::getPropertyValue(cfgParamId paramId,
                                   const string &_propertyName,
                                   string *rValue) const {
   utils::MutexLocker locker(&mutexCFGParams);
   CFGParam *param = NULL;
   if( getParam(&param, paramId) ) {
     CFGProperty property;
     property.setParamId( paramId );
     property.setPropertyIndex( param->getPropertyIndexByName(_propertyName) );
     property.setPropertyType(stringProperty);
     if( getProperty(&property) ) {
       property.getValue(rValue);
       return true;
     } else {
       return false;
     }
   } else {
     return false;
   }
 }
예제 #3
0
 bool CFGManager::setPropertyValue(const string &_group,
                                   const string &_name,
                                   const string &_propertyName,
                                   const string &rValue) {
   utils::MutexLocker locker(&mutexCFGParams);
   CFGParam *param = NULL;
   if( getParam(&param, _group, _name) ) {
     CFGProperty property;
     property.setParamId( param->getId() );
     property.setPropertyIndex( param->getPropertyIndexByName(_propertyName) );
     property.setPropertyType(stringProperty);
     property.setValue(rValue);
     if( setProperty(property) ) {
       return true;
     } else {
       return false;
     }
   } else {
     return false;
   }
 }