Ignore:
Timestamp:
Aug 1, 2013, 10:45:50 AM (11 years ago)
Author:
Marek Kurdej
Message:

Major update.
Renamed: addInput -> addInputs, addOutput -> addOutputs and made pure virtual (=0).
Transformed macro definitions into template methods: ADD_INPUT -> ComponentBase::addInput, ADD_OUTPUT -> ComponentBase::addOutput, GET_INPUT -> ComponentBase::getTypedInput, GET_OUTPUT -> ComponentBase::getTypedOutput.
Fixed: added public/protected set/get methods in ComponentBase, made member fields private.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0-beta1/src/PacpusLib/ComponentManager.cpp

    r146 r152  
    254254        } else {
    255255            component->param.localCopy(cfg.qDomElement());
    256             component->configuration_ = component->configureComponent(cfg);
     256            component->setConfigurationState(component->configureComponent(cfg));
    257257        }
    258258    } // for
     
    267267            LOG_WARN("component '" << componentName << "' does not exist");
    268268        } else {
    269            // Pacpus 2.0 : add input and output
    270             component->addInput();
    271             component->addOutput();
    272 
    273             if (component->configuration_ == ComponentBase::CONFIGURATION_DELAYED) {
     269           // Pacpus 2.0 : add inputs and outputs
     270            component->addInputs();
     271            component->addOutputs();
     272
     273            if (ComponentBase::CONFIGURATION_DELAYED == component->configurationState()) {
    274274                LOG_DEBUG("try to configure component '" << componentName << "'");
    275275
    276276                // copy locally the config parameters of the component
    277277                component->param.localCopy(cfg.qDomElement());
    278                 component->configuration_ = component->configureComponent(cfg);
     278                component->setConfigurationState(component->configureComponent(cfg));
    279279            }
    280280
    281             if (component->configuration_ == ComponentBase::CONFIGURED_OK) {
     281            if (ComponentBase::CONFIGURED_OK == component->configurationState()) {
    282282                --componentsToConfigureCount;
    283283            } else {
     
    286286                          << ". It was not configured, please review your configuration and/or your component"
    287287                          );
    288                 component->configuration_ = ComponentBase::CONFIGURED_FAILED;
     288                component->setConfigurationState(ComponentBase::CONFIGURED_FAILED);
    289289            }
    290290        }
Note: See TracChangeset for help on using the changeset viewer.