Changeset 176 in pacpusframework for trunk/src/PacpusLib/XmlComponentConfig.cpp


Ignore:
Timestamp:
Oct 11, 2013, 2:10:06 PM (11 years ago)
Author:
Marek Kurdej
Message:

Added: addParameters() method in ComponentBase using Boost.Program_Options.
Each component can declare its parameters and they will be read automatically before configureComponent() method.
See example ProducerConsumerExample constructors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PacpusLib/XmlComponentConfig.cpp

    r165 r176  
    88#include <Pacpus/kernel/Log.h>
    99#include <Pacpus/kernel/XmlConfigFile.h>
     10#include <QDomNamedNodeMap>
    1011
    1112using namespace pacpus;
     
    3738}
    3839
     40QDomNamedNodeMap XmlComponentConfig::getProperties() const
     41{
     42    return component_.attributes();
     43}
     44
    3945void XmlComponentConfig::addProperty(const QString& name)
    4046{
    41     if (hasProperty(name))
    42     {
     47    if (hasProperty(name)) {
    4348        LOG_ERROR("cannot add component property:"
    4449                  << " component '" << component_.attribute(kPropertyComponentName) << "'"
Note: See TracChangeset for help on using the changeset viewer.