Changeset 346 in dev for trunk/abdev/BasicCompiler_Common/src/Method.cpp
- Timestamp:
- Oct 10, 2007, 4:01:07 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Method.cpp
r206 r346 24 24 this->push_back( pMethod ); 25 25 pUserProc->SetMethod( pMethod ); 26 } 27 28 bool Methods::Override( UserProc *pUserProc, Prototype::Accessibility accessibility ) 29 { 30 //メソッドのオーバーライド 31 Methods &methods = *this; 32 BOOST_FOREACH( CMethod *pMethod, methods ) 33 { 34 if( pMethod->GetUserProc().GetName() == pUserProc->GetName() ) 35 { 36 if( pMethod->GetUserProc().Params().Equals( pUserProc->Params() ) 37 && pMethod->GetUserProc().ReturnType().Equals( pUserProc->ReturnType() ) ) 38 { 39 //メンバ関数を上書き 40 pMethod->SetUserProcPtr( pUserProc ); 41 pMethod->Override(); 42 43 if( !pMethod->IsVirtual() ) 44 { 45 // オーバーライドミス 46 SetError(136,NULL,cp); 47 } 48 if(pMethod->GetAccessibility() != accessibility ) 49 { 50 SetError(128,NULL,cp); 51 } 52 53 pUserProc->SetMethod( pMethod ); 54 return true; 55 } 56 } 57 } 58 return false; 26 59 } 27 60
Note:
See TracChangeset
for help on using the changeset viewer.