• <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;
                    }
            欧美亚洲国产精品久久蜜芽| 久久精品国产WWW456C0M| 国产精品久久久香蕉| 久久免费看黄a级毛片| 久久精品天天中文字幕人妻| 国产精品成人99久久久久| 久久婷婷是五月综合色狠狠| 久久无码av三级| 伊人久久久AV老熟妇色| 国产精品激情综合久久| 久久亚洲精品成人无码网站| 精品久久一区二区| 久久精品国产2020| 蜜桃麻豆www久久国产精品| 久久99精品国产| 欧洲人妻丰满av无码久久不卡 | 久久精品无码专区免费| 99久久99久久精品国产片果冻 | 亚洲精品综合久久| 色综合久久综精品| 国产精品久久永久免费| 亚洲av伊人久久综合密臀性色| 无码任你躁久久久久久| 国产免费福利体检区久久| 久久99久久99小草精品免视看 | 久久久久久午夜成人影院| 久久久久青草线蕉综合超碰| 三级韩国一区久久二区综合| 久久免费精品视频| 老司机国内精品久久久久| 国产精品久久99| 一级做a爱片久久毛片| 久久综合综合久久狠狠狠97色88| 国产亚洲欧美成人久久片| 久久精品亚洲精品国产色婷| 色婷婷久久综合中文久久蜜桃av | 久久久免费观成人影院| 国产一区二区精品久久岳 | 久久国产乱子伦免费精品| 久久精品aⅴ无码中文字字幕重口| 色88久久久久高潮综合影院|