Changeset 350 in dev for trunk/abdev/BasicCompiler_Common/src/Class.cpp
- Timestamp:
- Oct 14, 2007, 9:41:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r349 r350 449 449 interfaces.push_back( new ::Interface( &interfaceClass ) ); 450 450 451 // キャストメソッドを追加(内部コードは自動生成すること) 452 { 453 // Function Operator() As ITest 454 455 char temporary[1024]; 456 sprintf(temporary,"%c%c%c%c()%c%c%s", 457 1, ESC_FUNCTION, 458 1, ESC_OPERATOR, 459 1, ESC_AS, 460 interfaceClass.GetName().c_str() 461 ); 462 463 this->AddMethod(this, 464 Prototype::Public, 465 0, 466 false, // isConst 467 false, // isAbstract 468 false, // isVirtual 469 false, // isOverride 470 true, // isAutoGeneration 471 temporary, 472 -1 473 ); 474 } 475 451 476 return true; 452 477 } … … 505 530 506 531 void CClass::AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract, 507 bool isVirtual, bool isOverride, char *buffer, int nowLine){532 bool isVirtual, bool isOverride, bool isAutoGeneration, char *buffer, int nowLine){ 508 533 int i,i2; 509 534 char temporary[VN_SIZE]; … … 522 547 UserProc *pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Add( NamespaceScopes(), NamespaceScopesCollection(), buffer,nowLine,isVirtual,pobj_c, (bStatic!=0) ); 523 548 if(!pUserProc) return; 549 550 if( isAutoGeneration ) 551 { 552 // コード自動生成 553 pUserProc->ThisIsAutoGenerationProc(); 554 } 524 555 525 556 … … 665 696 } 666 697 667 void CClass::EnumDynamicMethodsO fInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const698 void CClass::EnumDynamicMethodsOrInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const 668 699 { 669 700 // 動的メソッド … … 676 707 } 677 708 } 678 const CMethod *CClass::GetDynamicMethodO fInterfaceMethod( const UserProc *pUserProc ) const709 const CMethod *CClass::GetDynamicMethodOrInterfaceMethod( const UserProc *pUserProc ) const 679 710 { 680 711 // 動的メソッド … … 687 718 { 688 719 result = pInterface->GetDynamicMethods().GetMethodPtr( pUserProc ); 720 if( result ) 721 { 722 return result; 723 } 689 724 } 690 725 } … … 854 889 SetError(); 855 890 return; 891 } 892 int CClass::GetVtblMasterListIndex( const CClass *pClass ) const 893 { 894 int result = 0; 895 896 BOOST_FOREACH( const ::Interface *pInterface, interfaces ) 897 { 898 result++; 899 900 if( &pInterface->GetClass() == pClass ) 901 { 902 return result; 903 } 904 } 905 906 SetError(); 907 return 0; 856 908 } 857 909 long CClass::GetVtblMasterListOffset() const … … 1428 1480 pobj_c->AddMethod(pobj_c, 1429 1481 Prototype::Public, //Publicアクセス権 1430 0, //Static指定なし 1431 false, //Constではない 1432 1, //Abstract 1433 1, //Virtual 1434 0, 1482 0, // bStatic 1483 false, // isConst 1484 true, // isAbstract 1485 true, // isVirtual 1486 false, // isOverride 1487 false, // isAutoGeneration 1435 1488 temporary, 1436 1489 sub_address … … 1719 1772 isVirtual, 1720 1773 isOverride, 1774 false, 1721 1775 temporary, 1722 1776 sub_address); … … 1946 2000 } 1947 2001 1948 pCompilingMethod = pParentClass->GetDynamicMethodO fInterfaceMethod( pUserProc );2002 pCompilingMethod = pParentClass->GetDynamicMethodOrInterfaceMethod( pUserProc ); 1949 2003 if( !pCompilingMethod ){ 1950 2004 pCompilingMethod = pParentClass->GetStaticMethods().GetMethodPtr( pUserProc );
Note:
See TracChangeset
for help on using the changeset viewer.