1 | #pragma once
|
---|
2 |
|
---|
3 | class CClass;
|
---|
4 |
|
---|
5 | class DynamicMethodsPrototype
|
---|
6 | {
|
---|
7 | // 動的メソッド
|
---|
8 | Methods dynamicMethods;
|
---|
9 |
|
---|
10 | // XMLシリアライズ用
|
---|
11 | private:
|
---|
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 |
|
---|
18 | public:
|
---|
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 |
|
---|
41 | class Interface : public DynamicMethodsPrototype
|
---|
42 | {
|
---|
43 | const CClass *pInterfaceClass;
|
---|
44 | mutable int vtblOffset;
|
---|
45 |
|
---|
46 | // 型パラメータ(実パラメータ)
|
---|
47 | Types actualTypeParameters;
|
---|
48 |
|
---|
49 | // XMLシリアライズ用
|
---|
50 | private:
|
---|
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 |
|
---|
62 | public:
|
---|
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 | std::string GetFullNameWithActualGenericTypeParameters() const;
|
---|
93 | };
|
---|
94 | typedef std::vector<Interface *> Interfaces;
|
---|