Ignore:
Timestamp:
Apr 30, 2008, 8:38:09 PM (16 years ago)
Author:
dai_9181
Message:

Interfaceクラスを独自ファイルにした。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp

    r511 r513  
    1414using namespace ActiveBasic::Compiler;
    1515
    16 
    17 Interface::Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters )
    18     : DynamicMethodsPrototype()
    19     , pInterfaceClass( pInterfaceClass )
    20     , vtblOffset( -1 )
    21     , actualTypeParameters( actualTypeParameters )
    22 {
    23     //メソッドをコピー
    24     BOOST_FOREACH( const CMethod *pBaseMethod, pInterfaceClass->GetDynamicMethods() )
    25     {
    26         CMethod *pMethod = new DynamicMethod( *pBaseMethod );
    27 
    28         // アクセシビリティ
    29         if(pBaseMethod->GetAccessibility() == Prototype::Private){
    30             pMethod->SetAccessibility( Prototype::None );
    31         }
    32         else{
    33             pMethod->SetAccessibility( pBaseMethod->GetAccessibility() );
    34         }
    35 
    36         //pobj_Inherits
    37         // ※継承元のClassIndexをセット(入れ子継承を考慮する)
    38         if(pBaseMethod->GetInheritsClassPtr()==0){
    39             pMethod->SetInheritsClassPtr( pInterfaceClass );
    40         }
    41         else{
    42             pMethod->SetInheritsClassPtr( pBaseMethod->GetInheritsClassPtr() );
    43         }
    44 
    45         AddDynamicMethods( pMethod );
    46     }
    47 }
    48 
    49 std::string Interface::GetFullNameWithActualGenericTypeParameters() const
    50 {
    51     std::string interfaceName = this->GetClass().GetFullName();
    52     if( actualTypeParameters.size() )
    53     {
    54         std::string actualGenericTypesName;
    55         BOOST_FOREACH( const Type &typeParameter, actualTypeParameters )
    56         {
    57             if( actualGenericTypesName.size() )
    58             {
    59                 actualGenericTypesName += ",";
    60             }
    61             actualGenericTypesName += typeParameter.ToString();
    62         }
    63 
    64         interfaceName += "<" + actualGenericTypesName + ">";
    65     }
    66     return interfaceName;
    67 }
    6816
    6917bool CClass::IsClass() const
Note: See TracChangeset for help on using the changeset viewer.