source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/src/Interface.cpp@ 528

Last change on this file since 528 was 513, checked in by dai_9181, 17 years ago

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

File size: 1.5 KB
Line 
1#include "stdafx.h"
2
3Interface::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
35std::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}
Note: See TracBrowser for help on using the repository browser.