• <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毛片久久| 国产精品视频久久久| 久久这里有精品视频| 午夜精品久久久内射近拍高清| 久久久久无码中| 久久伊人五月丁香狠狠色| 久久久精品2019免费观看| 国产激情久久久久影院老熟女| 久久亚洲中文字幕精品一区| 麻豆一区二区99久久久久| 99久久国产综合精品成人影院| 亚洲综合久久夜AV | 久久久精品人妻一区二区三区四| 久久久久久久亚洲精品| 久久亚洲精品人成综合网| 开心久久婷婷综合中文字幕| 久久精品蜜芽亚洲国产AV| 久久精品国产清自在天天线| 91精品国产综合久久婷婷| 久久天天躁狠狠躁夜夜躁2014| 欧美久久综合性欧美| 久久精品中文无码资源站| 久久亚洲AV成人无码| 久久久噜噜噜久久中文字幕色伊伊| 久久久精品人妻一区二区三区蜜桃| 久久久久国产精品三级网| 久久精品视频网| 精品一区二区久久久久久久网站| 久久婷婷人人澡人人爽人人爱| 久久亚洲天堂| 久久人人爽人人爽人人片AV麻豆| 国产精品久久久久9999高清| 中文字幕乱码人妻无码久久| 久久久噜噜噜久久中文字幕色伊伊| 久久久91人妻无码精品蜜桃HD| 久久香蕉综合色一综合色88| 91精品国产91久久久久福利| 久久久噜噜噜www成人网| 久久精品99久久香蕉国产色戒 | 国产一区二区精品久久| 国产精品一久久香蕉国产线看观看 |