Changeset 347 in dev for trunk/abdev/BasicCompiler_Common/src/Class.cpp
- Timestamp:
- Oct 11, 2007, 3:23:51 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r346 r347 665 665 } 666 666 667 void CClass::EnumDynamicMethodsOfInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const 668 { 669 // 動的メソッド 670 GetDynamicMethods().Enum( methodName, subs ); 671 672 // インターフェイス メソッド 673 BOOST_FOREACH( ::Interface *pInterface, GetInterfaces() ) 674 { 675 pInterface->GetDynamicMethods().Enum( methodName, subs ); 676 } 677 } 678 const CMethod *CClass::GetDynamicMethodOfInterfaceMethod( const UserProc *pUserProc ) const 679 { 680 // 動的メソッド 681 const CMethod *result = GetDynamicMethods().GetMethodPtr( pUserProc ); 682 683 if( !result ) 684 { 685 // インターフェイス メソッド 686 BOOST_FOREACH( ::Interface *pInterface, GetInterfaces() ) 687 { 688 result = pInterface->GetDynamicMethods().GetMethodPtr( pUserProc ); 689 } 690 } 691 692 return result; 693 } 694 667 695 const ::Delegate &CClass::GetDelegate() const 668 696 { … … 803 831 index++; 804 832 805 BOOST_FOREACH( const CMethod *pMethod, pInterface->Get Class().GetDynamicMethods() ){833 BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() ){ 806 834 if( &pMethod->GetUserProc() == pUserProc ) 807 835 { … … 833 861 return vtblMasterListOffset; 834 862 } 835 void CClass::GenerateVTablePart( long &vtableDataTableOffset ) const836 {837 const UserProc **ppsi = (const UserProc **)malloc(GetVtblNum()*sizeof(UserProc *));838 839 //関数テーブルに値をセット840 int i2 = 0;841 BOOST_FOREACH( const CMethod *pMethod, GetDynamicMethods() ){842 if(pMethod->IsVirtual()){843 if( !pMethod->GetUserProc().IsUsing() )844 {845 ts((char *)pMethod->GetUserProc().GetFullName().c_str());846 }847 pMethod->GetUserProc().Using();848 849 if(pMethod->IsAbstract()){850 extern int cp;851 SmoothieException::Throw(300,NULL,cp);852 853 ppsi[i2]=0;854 }855 else{856 ppsi[i2]=&pMethod->GetUserProc();857 }858 i2++;859 }860 }861 862 vtableDataTableOffset = compiler.GetObjectModule().dataTable.AddBinary( (void *)ppsi, GetVtblNum()*sizeof(LONG_PTR) );863 864 for( int i=0; i < GetVtblNum(); i++ ){865 pobj_Reloc->AddSchedule_DataSection(static_cast<DWORD>(vtableDataTableOffset+i*sizeof(LONG_PTR)));866 }867 868 free(ppsi);869 }870 863 void CClass::GenerateVTableMasterList( const std::vector<long> &vtableMasterList, long &offset ) 871 864 { … … 895 888 896 889 // 自身のクラスのvtblを生成 897 Ge nerateVTablePart( this->vtbl_offset );890 GetDynamicMethods().GenerateVTablePart( this->vtbl_offset ); 898 891 vtblMasterList.push_back( this->vtbl_offset ); 899 892 … … 902 895 { 903 896 long tempVtblOffset; 904 pInterface->Get Class().GenerateVTablePart( tempVtblOffset );897 pInterface->GetDynamicMethods().GenerateVTablePart( tempVtblOffset ); 905 898 vtblMasterList.push_back( tempVtblOffset ); 906 899 … … 946 939 BOOST_FOREACH( const ::Interface *pInterface, interfaces ) 947 940 { 948 LONG_PTR *pVtbl = (LONG_PTR *)((char *)compiler.GetObjectModule().dataTable.GetPtr() + pInterface->Get Class().vtbl_offset);941 LONG_PTR *pVtbl = (LONG_PTR *)((char *)compiler.GetObjectModule().dataTable.GetPtr() + pInterface->GetVtblOffset()); 949 942 950 943 for( int i=0; i<pInterface->GetClass().GetVtblNum(); i++ ){ … … 1945 1938 } 1946 1939 1947 pCompilingMethod = pParentClass->GetDynamicMethod s().GetMethodPtr( pUserProc );1940 pCompilingMethod = pParentClass->GetDynamicMethodOfInterfaceMethod( pUserProc ); 1948 1941 if( !pCompilingMethod ){ 1949 1942 pCompilingMethod = pParentClass->GetStaticMethods().GetMethodPtr( pUserProc );
Note:
See TracChangeset
for help on using the changeset viewer.