Changeset 288 in pacpusframework for trunk/src/DBITEPlayerLib/DbtPlyTrigger.cpp


Ignore:
Timestamp:
Mar 26, 2014, 9:27:30 PM (11 years ago)
Author:
Marek Kurdej
Message:

Using boost::shared_ptr for storing components.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/DBITEPlayerLib/DbtPlyTrigger.cpp

    r152 r288  
    3939ComponentBase::COMPONENT_CONFIGURATION DbtPlyTrigger::configureComponent(XmlComponentConfig /*config*/)
    4040{
     41    using boost::dynamic_pointer_cast;
     42
    4143    ComponentManager * mgr = ComponentManager::getInstance();
    4244    // we get a pointer to the engine component
    43     mEngine = dynamic_cast<DbtPlyEngine *>(mgr->getComponent("dbiteEngine"));
    44     if (NULL == mEngine) {
     45    mEngine = dynamic_pointer_cast<DbtPlyEngine>(mgr->getComponent("dbiteEngine"));
     46    if (!mEngine) {
    4547        LOG_FATAL("cannot get a pointer of the 'dbiteEngine' component");
    4648        return CONFIGURED_FAILED;
    4749    }
    4850    connect(this, SIGNAL(triggerSig()),
    49             mEngine,SLOT(engReceiver()),
     51            mEngine.get(), SLOT(engReceiver()),
    5052            Qt::DirectConnection);
    5153
Note: See TracChangeset for help on using the changeset viewer.