際際滷

際際滷Share a Scribd company logo
GPG Study
1.4 1.7 1.12



               visualwizard
1.4 蟆 襦蠏碁覦 STL 

1.7 螻 覃覈襴 蟯襴

1.12 assert 觜覯
1.4 蟆 襦蠏碁覦 STL 




                              Genericity of components




  The use of templates allow you to reduce the number m to 1
  ( m is possible data types ).
  STL algorithms, however, do not work directly with containers but with
  Interface object, that is, iterators which access containers.
1.4 蟆 襦蠏碁覦 STL 




                             Abstract and implicit data types




  Implicit data types are not important in the sense of an object-oriented
  analysis which puts the emphasis on the interfaces (methods) if an abstract
  data types. They, however, are very important for design and
  Implementation because they often determine the run time behavior.
1.4 蟆 襦蠏碁覦 STL 

 Containers
  谿 貉企 ( sequence container )
  vector, list, deque, 

  郁 貉企 ( associative container )
  map, set, 


 Iterators
  Pointer-like objects


 Algorithms
  The Template algorithms work with iterators that access containers.
1.4 蟆 襦蠏碁覦 STL 




   begin() , end()     螻襴讀 last iterator 襷讌襷 襯
                       螳襴れ .
   rbegin() , rend()
                       past-the-end




   Call by value
1.4 蟆 襦蠏碁覦 STL 

 Container

  Sequence container
    狩 螳豌企れ 朱 蟲



  vector< T > : 貉企   蠏( i覯讌  蠏 螳  )
  螳ロ.


  deque< T > : vector  . 貉企  覿覿 一一 螳ロ.


  list< T >   :  蠏 螳 O(N). N 蠍. 曙螻   螳.
1.4 蟆 襦蠏碁覦 STL 

 Container

  Associative container
   譯殊伎 る 螳豌企れ 蟆 谿場



  set< key >         : 狩  ( unique key )

  multiset< key >    : 譴覲牛るゼ 讌 ( duplicate key )



  map< key, T >      : key unique. T value. 譯殊伎 key襦 value襯 谿場  .

  multimap<key, T>   : map螻 . key 譴覲旧
1.4 蟆 襦蠏碁覦 STL 

 Iterator
  -iterator
  豢-iterator
  覦-iterator
  

  螳螳 iteratorれ 轟 一一襯 蟲螻 伎 .


 Algorithms
  nonmutating sequence algorithm   : find , search
  mutating sequence algorithm      : unique
  sorting-related algorithm
  generalized numeric algorithm
1.4 蟆 襦蠏碁覦 STL 




                         caf辿.naver.com/architect1
1.7 螻 覃覈襴 蟯襴

 蟆 襷 覃覈襴  蟲. ( 蠏碁, 企, 覈, 覃伎 .. )

  => 覈 蟆 襴( 一危 襦 or 蟆 ′ ) 蟆 .
  => 譯殊伎 覃覈襴 覲企 襷    襦 譴觜



  伎 蠍磯 一危磯ゼ 朱 覿り碓 蠍壱  
  螳豌 

 企  螳ロ れ 蟯襴 , 覿覦 覦 蠏殊 危 蟯襴.
1.7 螻 覃覈襴 蟯襴

 class BaseResource
  るジ  貉企 企るれ  企るゼ 蠍磯朱  



  Create() -  一危一 襦. 覦覲旧  豌  豌襴 


  Dispose() , Recrete()  螻 覃覈襴 蟲豌.  覩  覿覿る
  蟲豌危.


  operator < ()   蠍磯ゼ  一
1.7 螻 覃覈襴 蟯襴

 class BaseResource
1.7 螻 覃覈襴 蟯襴

 class ResManager
  BaseResource襯 牛 焔
  れ 蟯襴 企
1.7 螻 覃覈襴 蟯襴

 class ResManager



    碁(UINT) 螻 螳豌伎  誤磯ゼ Map朱 蟯襴



   typedef std::map<RHANDLE, BaseResource*> ResMap;
   typedef ResMap::iterator ResMapItor;
   typedef ResMap::value_type ResMapPair;
1.7 螻 覃覈襴 蟯襴

 class ResManager
   InsertResource()  豢螳  蠍郁  譴觜 覃覈襴覲企  蟆曙
    覃覈襴襯 覲危  蟾讌 蠍一ヾ  伎. ( 一 磯 )
1.12 assert 觜覯

 #1 :  襷 覲企ゼ 讌企k.




            assert  伎襯 string朱 豢螳
1.12 assert 觜覯

 #2 : 譬  襷 覲企ゼ 讌企k.




     assert(0)

     assert(! 譬  襷 覲企も)




            襦蠏碁 讌 襷  螻褐 螳讌.
            蠏碁Μ螻 覯蟾 覲企ゼ 螻
1.12 assert 觜覯

 #3 : 譬  ク蟆
1.12 assert 觜覯

 #4 : 貉れろ assert 襷り鍵




      貉れろ 襯 襷り 蟆郁骸 磯 貊襯 breaking .
1.12 assert 觜覯

 #5 : 願 譴




      譯 ろ 襭伎  蟆曙 flag襯 譯殊伎  螳 磯
       覿襯 蟆一襦
1.12 assert 觜覯

 #6 : 豐螻襷 覲 蟆


      assert螳 ろ 伎  蠏 伎 語 .

      -> 襦蠏碁 ろ 覲願 !




                      BugSlayer


   http://blog.naver.com/harkon?Redirect=Log&logNo=120063141029
1.12 assert 觜覯

 #7 : 譬  所  覲旧伎 覿 j鍵




      ろ 覲伎 伎 企暑慨襦. CustomAssertFunction 豢螳
1.12 assert 觜覯

More Related Content

Gpg1

  • 1. GPG Study 1.4 1.7 1.12 visualwizard
  • 2. 1.4 蟆 襦蠏碁覦 STL 1.7 螻 覃覈襴 蟯襴 1.12 assert 觜覯
  • 3. 1.4 蟆 襦蠏碁覦 STL Genericity of components The use of templates allow you to reduce the number m to 1 ( m is possible data types ). STL algorithms, however, do not work directly with containers but with Interface object, that is, iterators which access containers.
  • 4. 1.4 蟆 襦蠏碁覦 STL Abstract and implicit data types Implicit data types are not important in the sense of an object-oriented analysis which puts the emphasis on the interfaces (methods) if an abstract data types. They, however, are very important for design and Implementation because they often determine the run time behavior.
  • 5. 1.4 蟆 襦蠏碁覦 STL Containers 谿 貉企 ( sequence container ) vector, list, deque, 郁 貉企 ( associative container ) map, set, Iterators Pointer-like objects Algorithms The Template algorithms work with iterators that access containers.
  • 6. 1.4 蟆 襦蠏碁覦 STL begin() , end() 螻襴讀 last iterator 襷讌襷 襯 螳襴れ . rbegin() , rend() past-the-end Call by value
  • 7. 1.4 蟆 襦蠏碁覦 STL Container Sequence container 狩 螳豌企れ 朱 蟲 vector< T > : 貉企 蠏( i覯讌 蠏 螳 ) 螳ロ. deque< T > : vector . 貉企 覿覿 一一 螳ロ. list< T > : 蠏 螳 O(N). N 蠍. 曙螻 螳.
  • 8. 1.4 蟆 襦蠏碁覦 STL Container Associative container 譯殊伎 る 螳豌企れ 蟆 谿場 set< key > : 狩 ( unique key ) multiset< key > : 譴覲牛るゼ 讌 ( duplicate key ) map< key, T > : key unique. T value. 譯殊伎 key襦 value襯 谿場 . multimap<key, T> : map螻 . key 譴覲旧
  • 9. 1.4 蟆 襦蠏碁覦 STL Iterator -iterator 豢-iterator 覦-iterator 螳螳 iteratorれ 轟 一一襯 蟲螻 伎 . Algorithms nonmutating sequence algorithm : find , search mutating sequence algorithm : unique sorting-related algorithm generalized numeric algorithm
  • 10. 1.4 蟆 襦蠏碁覦 STL caf辿.naver.com/architect1
  • 11. 1.7 螻 覃覈襴 蟯襴 蟆 襷 覃覈襴 蟲. ( 蠏碁, 企, 覈, 覃伎 .. ) => 覈 蟆 襴( 一危 襦 or 蟆 ′ ) 蟆 . => 譯殊伎 覃覈襴 覲企 襷 襦 譴觜 伎 蠍磯 一危磯ゼ 朱 覿り碓 蠍壱 螳豌 企 螳ロ れ 蟯襴 , 覿覦 覦 蠏殊 危 蟯襴.
  • 12. 1.7 螻 覃覈襴 蟯襴 class BaseResource るジ 貉企 企るれ 企るゼ 蠍磯朱 Create() - 一危一 襦. 覦覲旧 豌 豌襴 Dispose() , Recrete() 螻 覃覈襴 蟲豌. 覩 覿覿る 蟲豌危. operator < () 蠍磯ゼ 一
  • 13. 1.7 螻 覃覈襴 蟯襴 class BaseResource
  • 14. 1.7 螻 覃覈襴 蟯襴 class ResManager BaseResource襯 牛 焔 れ 蟯襴 企
  • 15. 1.7 螻 覃覈襴 蟯襴 class ResManager 碁(UINT) 螻 螳豌伎 誤磯ゼ Map朱 蟯襴 typedef std::map<RHANDLE, BaseResource*> ResMap; typedef ResMap::iterator ResMapItor; typedef ResMap::value_type ResMapPair;
  • 16. 1.7 螻 覃覈襴 蟯襴 class ResManager InsertResource() 豢螳 蠍郁 譴觜 覃覈襴覲企 蟆曙 覃覈襴襯 覲危 蟾讌 蠍一ヾ 伎. ( 一 磯 )
  • 17. 1.12 assert 觜覯 #1 : 襷 覲企ゼ 讌企k. assert 伎襯 string朱 豢螳
  • 18. 1.12 assert 觜覯 #2 : 譬 襷 覲企ゼ 讌企k. assert(0) assert(! 譬 襷 覲企も) 襦蠏碁 讌 襷 螻褐 螳讌. 蠏碁Μ螻 覯蟾 覲企ゼ 螻
  • 19. 1.12 assert 觜覯 #3 : 譬 ク蟆
  • 20. 1.12 assert 觜覯 #4 : 貉れろ assert 襷り鍵 貉れろ 襯 襷り 蟆郁骸 磯 貊襯 breaking .
  • 21. 1.12 assert 觜覯 #5 : 願 譴 譯 ろ 襭伎 蟆曙 flag襯 譯殊伎 螳 磯 覿襯 蟆一襦
  • 22. 1.12 assert 觜覯 #6 : 豐螻襷 覲 蟆 assert螳 ろ 伎 蠏 伎 語 . -> 襦蠏碁 ろ 覲願 ! BugSlayer http://blog.naver.com/harkon?Redirect=Log&logNo=120063141029
  • 23. 1.12 assert 觜覯 #7 : 譬 所 覲旧伎 覿 j鍵 ろ 覲伎 伎 企暑慨襦. CustomAssertFunction 豢螳