• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 311, comments - 0, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            指針可以指向基本類型,也可以指向復合類型,因此也可以指向另外一個指針變量,稱為指向指針的指針。

            int i;
            int *pi = &i;
            int **ppi = &pi;

            這樣定義之后,表達式*ppi取pi的值,表達式**ppi取i的值。請讀者自己畫圖理解i、pi、ppi這三個變量之間的關系。

            案例:遞歸查找對象并返回對象指針

            bool CustomEntity::getEntityByPart(const String& partID, graphics::IEntity* inEntity, graphics::IEntity** outEntity)
                    {
                        
            //
                        if (inEntity && (inEntity->getPartID() == partID))
                        {
                            
            return true;
                        }
                        
            //
                        graphics::EntityPtrList::iterator iter;
                        
            if(inEntity->getSkeleton())        
                        {
                            graphics::EntityPtrList entityList 
            = inEntity->getSkeleton()->getEntities(); 
                            
            for (iter =  entityList.begin(); iter != entityList.end(); ++ iter)
                            {
                                graphics::IEntity
            * entity = *iter;                    
                                
            if(getEntityByPart(partID, entity, outEntity))
                                {
                                    
            *outEntity = entity;
                                    
            return true;
                                }
                            }
                        }
                        
            return false;
                    }

                    
            bool CustomEntity::getEntityByPart(const String& partID, graphics::IEntity** outEntity)
                    {
                        
            int num = model_->numComponents();
                        
            for (int i = 0; i < num; ++i)
                        {
                            model::ModelComponent 
            *mc = model_->getComponentByIndex(i);
                            
            if (mc->getType() == model::ModelComponent::MCT_GRAPHIC)
                            {
                                model::Graphical 
            *gc = static_cast<model::Graphical *>(mc);
                                model::Graphical::TagEntityMap::iterator itEntity 
            = gc->entities_.begin();
                                model::Graphical::TagEntityMap::iterator itEnd 
            = gc->entities_.end();
                                
            while (itEntity != itEnd)
                                {
                                    graphics::IEntity
            * entity = itEntity->second.p_;
                                    
            if(getEntityByPart(partID, entity, outEntity))
                                    {
                                        
            *outEntity = entity;
                                        
            return true;
                                    }
                                    
            ++itEntity;
                                }
                            }
                        }
                        
            return false;
                    }
            亚洲欧洲中文日韩久久AV乱码| 久久WWW免费人成一看片| 午夜人妻久久久久久久久| 精品久久久久久无码专区不卡| 热久久这里只有精品| 久久久久久亚洲精品影院| 色欲久久久天天天综合网| 97久久综合精品久久久综合| 狠狠色伊人久久精品综合网 | 久久天天躁狠狠躁夜夜躁2O2O| 久久99精品国产99久久6男男| 日韩欧美亚洲综合久久影院Ds| 亚洲国产精品18久久久久久| 久久久久久国产精品美女| 久久久女人与动物群交毛片| 亚洲国产成人精品女人久久久 | 国产精品久久永久免费| 久久91精品国产91久| 久久久久久久久久免免费精品| 国产精品免费福利久久| 99精品国产综合久久久久五月天| 久久成人精品| 97r久久精品国产99国产精| 久久久久亚洲精品日久生情 | 免费观看成人久久网免费观看| 国产毛片欧美毛片久久久| 久久久久亚洲精品无码网址| 国产91久久综合| 国产A级毛片久久久精品毛片| 久久亚洲高清观看| av无码久久久久不卡免费网站 | 久久99精品久久久久久久久久| 久久丫忘忧草产品| 精品久久久久久久国产潘金莲| 久久综合九色欧美综合狠狠| 四虎影视久久久免费观看| 亚洲人成无码久久电影网站| 欧美成人免费观看久久| 精品一二三区久久aaa片| 久久人人爽人人人人片av| 99久久精品国产一区二区 |