Show
Ignore:
Timestamp:
02/25/09 02:12:51 (4 years ago)
Author:
shereef
Message:

DeviceManager? now supports multiple implementations

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/trunk/system/ossie/framework/DeviceManager_impl.cpp

    r8759 r8772  
    177177//Parse local componenents from DCD files 
    178178     std::vector <componentPlacement> componentPlacements = _DCDParser.getComponentPlacements (); 
     179     if( componentPlacements.size() == 0 ) 
     180     { 
     181      for( unsigned int i = 0; i < _DCDParser.getDeployOnComponents()->size(); i++ ) 
     182      { 
     183       componentPlacements.push_back(componentPlacement( 
     184        (*_DCDParser.getDeployOnComponents())[i]->getFileRefId(), 
     185        (*_DCDParser.getDeployOnComponents())[i]->getInstantiationId(), 
     186        (*_DCDParser.getDeployOnComponents())[i]->getUsageName() )); 
     187      } 
     188     } 
    179189     DEBUG(2, DevMgr, "ComponentPlacement size is" << componentPlacements.size()) 
    180190     for (unsigned int i = 0; i < componentPlacements.size(); i++) 
     
    209219      for( unsigned int j = 0; j < _implementations->size(); j++ ) 
    210220      { 
    211        std::cout << "[DeviceManager::post_ctor] Checking idx: " << j << std::endl; 
     221       std::cout << "[DeviceManager::post_ctor] Checking idx: " << j << " of " << _implementations->size() << std::endl; 
    212222       std::vector< std::string > _devprocessors = (*_implementations)[j]->getProcessors(); 
    213        std::vector< std::string > _devmgrprocessors = (*_devmgrspdimpl)[j]->getProcessors(); 
     223       std::vector< std::string > _devmgrprocessors = (*_devmgrspdimpl)[0]->getProcessors(); 
    214224        // Assume only one processor per implementation 
    215225        // -- test if the target processor matches; if not, get next implementation 
     226       DEBUG(4, DevMgr, "Comparing processors") 
    216227       if( _devprocessors[0] != _devmgrprocessors[0] ) continue; 
     228       DEBUG(4, DevMgr, "Device processor matches DeviceManager processor") 
    217229       OSAttributes _devosattr = (*_implementations)[j]->getOperatingSystem(); 
    218        OSAttributes _devmgrosattr = (*_devmgrspdimpl)[j]->getOperatingSystem(); 
     230       OSAttributes _devmgrosattr = (*_devmgrspdimpl)[0]->getOperatingSystem(); 
    219231        // -- test if the target OS matches; if not, get next implementation 
    220        if( strcmp( _devosattr.getOSName(), _devmgrosattr.getOSName() ) != 0 ) continue; 
     232       DEBUG(4, DevMgr, "Comparing OSes") 
     233       if( strcmp( _devosattr.getOSName(), _devmgrosattr.getOSName() ) < 0 ) continue; 
     234       DEBUG(4, DevMgr, "Device OS matches DeviceManager OS") 
    221235       _implIdx = j; 
    222236       break; 
     
    236250      int myPid2; 
    237251 
    238       DEBUG(2, DevMgr, "Launching Device file " << (*_implementations)[_implIdx]->getCodeFile () << " Usage name " << componentPlacements[_implIdx].usageName()) 
     252      DEBUG(2, DevMgr, "Launching Device file " << (*_implementations)[_implIdx]->getCodeFile () << " Usage name " << componentPlacements[i].usageName()) 
    239253 
    240254      if ((myPid2 = fork()) < 0) std::cout << "Fork Error" << std::endl;