source: dev/trunk/ab5.0/abdev/ab_common/include/Lexical/Interface.h@ 707

Last change on this file since 707 was 640, checked in by dai_9181, 16 years ago

静的リンクリンカの依存関係解決モジュールを製作中

File size: 2.3 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 int 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 {
76 return *pInterfaceClass;
77 }
78 int GetVtblOffset() const
79 {
80 return vtblOffset;
81 }
82 void SetVtblOffset( int vtblOffset ) const
83 {
84 this->vtblOffset = vtblOffset;
85 }
86
87 const Types &GetActualTypeParameters() const
88 {
89 return actualTypeParameters;
90 }
91
92 bool Equals( const Interface *pInterface ) const;
93
94 std::string GetFullNameWithActualGenericTypeParameters() const;
95
96 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
97};
98typedef std::vector<Interface *> Interfaces;
Note: See TracBrowser for help on using the repository browser.