source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/include/Interface.h@ 563

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

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

File size: 2.2 KB
Line 
1#pragma once
2
3class CClass;
4
5class DynamicMethodsPrototype
6{
7 // 動的メソッド
8 Methods dynamicMethods;
9
10 // XMLシリアライズ用
11private:
12 friend class boost::serialization::access;
13 template<class Archive> void serialize(Archive& ar, const unsigned int version)
14 {
15 ar & BOOST_SERIALIZATION_NVP( dynamicMethods );
16 }
17
18public:
19 DynamicMethodsPrototype(){}
20 DynamicMethodsPrototype( const DynamicMethodsPrototype &dynamicMethodsPrototype )
21 : dynamicMethods( dynamicMethodsPrototype.dynamicMethods )
22 {
23 }
24 ~DynamicMethodsPrototype(){}
25
26 const Methods &GetDynamicMethods() const
27 {
28 return dynamicMethods;
29 }
30 Methods &GetDynamicMethods()
31 {
32 return dynamicMethods;
33 }
34
35 void AddDynamicMethods( CMethod *pMethod )
36 {
37 dynamicMethods.push_back( pMethod );
38 }
39};
40
41class Interface : public DynamicMethodsPrototype
42{
43 const CClass *pInterfaceClass;
44 mutable LONG_PTR vtblOffset;
45
46 // 型パラメータ(実パラメータ)
47 Types actualTypeParameters;
48
49 // XMLシリアライズ用
50private:
51 friend class boost::serialization::access;
52 template<class Archive> void serialize(Archive& ar, const unsigned int version)
53 {
54 trace_for_serialize( "serializing - Interface" );
55
56 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( DynamicMethodsPrototype );
57 ar & boost::serialization::make_nvp("pInterfaceClass", const_cast<CClass *&>(pInterfaceClass) );
58 ar & BOOST_SERIALIZATION_NVP( vtblOffset );
59 ar & BOOST_SERIALIZATION_NVP( actualTypeParameters );
60 }
61
62public:
63 Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters );
64 Interface( const Interface &objInterface )
65 : DynamicMethodsPrototype( objInterface )
66 , pInterfaceClass( objInterface.pInterfaceClass )
67 , vtblOffset( objInterface.vtblOffset )
68 {
69 }
70 Interface()
71 {
72 }
73
74 const CClass &GetClass() const{
75 return *pInterfaceClass;
76 }
77 LONG_PTR GetVtblOffset() const
78 {
79 return vtblOffset;
80 }
81 void SetVtblOffset( LONG_PTR vtblOffset ) const
82 {
83 this->vtblOffset = vtblOffset;
84 }
85
86 const Types &GetActualTypeParameters() const
87 {
88 return actualTypeParameters;
89 }
90
91 std::string GetFullNameWithActualGenericTypeParameters() const;
92};
93typedef std::vector<Interface *> Interfaces;
Note: See TracBrowser for help on using the repository browser.