[513] | 1 | #include "stdafx.h"
|
---|
| 2 |
|
---|
| 3 | Interface::Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters )
|
---|
| 4 | : DynamicMethodsPrototype()
|
---|
| 5 | , pInterfaceClass( pInterfaceClass )
|
---|
| 6 | , vtblOffset( -1 )
|
---|
| 7 | , actualTypeParameters( actualTypeParameters )
|
---|
| 8 | {
|
---|
| 9 | //メソッドをコピー
|
---|
| 10 | BOOST_FOREACH( const CMethod *pBaseMethod, pInterfaceClass->GetDynamicMethods() )
|
---|
| 11 | {
|
---|
| 12 | CMethod *pMethod = new DynamicMethod( *pBaseMethod );
|
---|
| 13 |
|
---|
| 14 | // アクセシビリティ
|
---|
| 15 | if(pBaseMethod->GetAccessibility() == Prototype::Private){
|
---|
| 16 | pMethod->SetAccessibility( Prototype::None );
|
---|
| 17 | }
|
---|
| 18 | else{
|
---|
| 19 | pMethod->SetAccessibility( pBaseMethod->GetAccessibility() );
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | //pobj_Inherits
|
---|
| 23 | // ※継承元のClassIndexをセット(入れ子継承を考慮する)
|
---|
| 24 | if(pBaseMethod->GetInheritsClassPtr()==0){
|
---|
| 25 | pMethod->SetInheritsClassPtr( pInterfaceClass );
|
---|
| 26 | }
|
---|
| 27 | else{
|
---|
| 28 | pMethod->SetInheritsClassPtr( pBaseMethod->GetInheritsClassPtr() );
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | AddDynamicMethods( pMethod );
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | std::string Interface::GetFullNameWithActualGenericTypeParameters() const
|
---|
| 36 | {
|
---|
| 37 | std::string interfaceName = this->GetClass().GetFullName();
|
---|
| 38 | if( actualTypeParameters.size() )
|
---|
| 39 | {
|
---|
| 40 | std::string actualGenericTypesName;
|
---|
| 41 | BOOST_FOREACH( const Type &typeParameter, actualTypeParameters )
|
---|
| 42 | {
|
---|
| 43 | if( actualGenericTypesName.size() )
|
---|
| 44 | {
|
---|
| 45 | actualGenericTypesName += ",";
|
---|
| 46 | }
|
---|
| 47 | actualGenericTypesName += typeParameter.ToString();
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | interfaceName += "<" + actualGenericTypesName + ">";
|
---|
| 51 | }
|
---|
| 52 | return interfaceName;
|
---|
| 53 | }
|
---|