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


Ignore:
Timestamp:
03/26/14 21:27:30 (10 years ago)
Author:
Marek Kurdej
Message:

Using boost::shared_ptr for storing components.

File:
1 edited

Legend:

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

    r181 r288  
    6767ComponentBase::COMPONENT_CONFIGURATION DbtPlyFileManager::configureComponent(XmlComponentConfig config)
    6868{
     69    using boost::dynamic_pointer_cast;
     70
    6971    ComponentManager * mgr = ComponentManager::getInstance();
    70     mEngine = static_cast<DbtPlyEngine *>(mgr->getComponent("dbiteEngine"));
    71     if (NULL == mEngine ) {
     72    mEngine = dynamic_pointer_cast<DbtPlyEngine>(mgr->getComponent("dbiteEngine"));
     73    if (!mEngine) {
    7274        LOG_FATAL("cannot get a pointer of the 'dbiteEngine' component");
    7375        return CONFIGURED_FAILED;
     
    8183    // register the road_time_t type for the connection
    8284    qRegisterMetaType<road_time_t>("road_time_t");
    83     connect(mEngine, SIGNAL(play(road_time_t,road_time_t, bool)),
     85    connect(mEngine.get(), SIGNAL(play(road_time_t,road_time_t, bool)),
    8486            this, SLOT(playData(road_time_t,road_time_t, bool)),
    8587            Qt::DirectConnection);
    8688    connect(this, SIGNAL(tMinMaxIs(road_time_t,road_time_t )),
    87             mEngine, SLOT(tMinMax(road_time_t, road_time_t)));
    88     connect(mEngine, SIGNAL(stopfile()),
     89            mEngine.get(), SLOT(tMinMax(road_time_t, road_time_t)));
     90    connect(mEngine.get(), SIGNAL(stopfile()),
    8991            this, SLOT (beginfile()));
    9092
Note: See TracChangeset for help on using the changeset viewer.