Changeset 343 in dev for trunk/abdev/BasicCompiler_Common


Ignore:
Timestamp:
Oct 9, 2007, 1:51:56 AM (17 years ago)
Author:
dai_9181
Message:
 
Location:
trunk/abdev/BasicCompiler_Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/include/Class.h

    r342 r343  
    5050    mutable int vtblOffset;
    5151public:
    52     Interface( const CClass *pInterfaceClass )
    53         : pInterfaceClass( pInterfaceClass )
    54         , vtblOffset( -1 )
    55     {
    56     }
     52    Interface( const CClass *pInterfaceClass );
    5753
    5854    const CClass &GetClass() const{
  • trunk/abdev/BasicCompiler_Common/src/Class.cpp

    r342 r343  
    7474};
    7575CLoopRefCheck *pobj_LoopRefCheck;
     76
     77
     78Interface::Interface( const CClass *pInterfaceClass )
     79    : pInterfaceClass( pInterfaceClass )
     80    , vtblOffset( -1 )
     81{
     82    //メソッドをコピー
     83    BOOST_FOREACH( const CMethod *pBaseMethod, pInterfaceClass->GetDynamicMethods() )
     84    {
     85        CMethod *pMethod = new DynamicMethod( *pBaseMethod );
     86
     87        // アクセシビリティ
     88        if(pBaseMethod->GetAccessibility() == Prototype::Private){
     89            pMethod->SetAccessibility( Prototype::None );
     90        }
     91        else{
     92            pMethod->SetAccessibility( pBaseMethod->GetAccessibility() );
     93        }
     94
     95        //pobj_Inherits
     96        // ※継承元のClassIndexをセット(入れ子継承を考慮する)
     97        if(pBaseMethod->GetInheritsClassPtr()==0){
     98            pMethod->SetInheritsClassPtr( pInterfaceClass );
     99        }
     100        else{
     101            pMethod->SetInheritsClassPtr( pBaseMethod->GetInheritsClassPtr() );
     102        }
     103
     104        GetDynamicMethods().push_back( pMethod );
     105    }
     106}
    76107
    77108
Note: See TracChangeset for help on using the changeset viewer.