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

Last change on this file since 829 was 829, checked in by イグトランス (egtra), 12 years ago

svn:eol-styleとsvn:mime-type(文字コード指定含む)の設定

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/plain; charset=Shift_JIS
File size: 3.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(DynamicMethodsPrototype&& dynamicMethodsPrototype)
21 : dynamicMethods(std::move(dynamicMethodsPrototype.dynamicMethods))
22 {
23 }
24 DynamicMethodsPrototype(const DynamicMethodsPrototype &dynamicMethodsPrototype)
25 : dynamicMethods(dynamicMethodsPrototype.dynamicMethods)
26 {
27 }
28
29 DynamicMethodsPrototype& operator =(DynamicMethodsPrototype&& y)
30 {
31 dynamicMethods = std::move(y.dynamicMethods);
32 return *this;
33 }
34
35 DynamicMethodsPrototype& operator =(DynamicMethodsPrototype const& y)
36 {
37 return *this = std::move(DynamicMethodsPrototype(y));
38 }
39
40 ~DynamicMethodsPrototype(){}
41
42 const Methods &GetDynamicMethods() const
43 {
44 return dynamicMethods;
45 }
46 Methods &GetDynamicMethods()
47 {
48 return dynamicMethods;
49 }
50
51 void AddDynamicMethods( CMethod *pMethod )
52 {
53 dynamicMethods.push_back( pMethod );
54 }
55};
56
57class Interface : public DynamicMethodsPrototype
58{
59 const CClass *pInterfaceClass;
60 mutable int vtblOffset;
61
62 // 型パラメータ(実パラメータ)
63 Types actualTypeParameters;
64
65 // XMLシリアライズ用
66private:
67 friend class boost::serialization::access;
68 template<class Archive> void serialize(Archive& ar, const unsigned int version)
69 {
70 trace_for_serialize( "serializing - Interface" );
71
72 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( DynamicMethodsPrototype );
73 ar & boost::serialization::make_nvp("pInterfaceClass", const_cast<CClass *&>(pInterfaceClass) );
74 ar & BOOST_SERIALIZATION_NVP( vtblOffset );
75 ar & BOOST_SERIALIZATION_NVP( actualTypeParameters );
76 }
77
78public:
79 Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters );
80 Interface(Interface&& objInterface)
81 : DynamicMethodsPrototype(std::move(objInterface))
82 , pInterfaceClass(std::move(objInterface.pInterfaceClass))
83 , vtblOffset(std::move(objInterface.vtblOffset))
84 {
85 }
86 Interface( const Interface &objInterface )
87 : DynamicMethodsPrototype( objInterface )
88 , pInterfaceClass( objInterface.pInterfaceClass )
89 , vtblOffset( objInterface.vtblOffset )
90 {
91 }
92 Interface()
93 : pInterfaceClass( NULL )
94 , vtblOffset( NULL )
95 {
96 }
97
98 Interface& operator =(Interface&& y)
99 {
100 DynamicMethodsPrototype::operator =(std::move(y));
101 pInterfaceClass = std::move(y.pInterfaceClass);
102 vtblOffset = std::move(y.vtblOffset);
103 return *this;
104 }
105
106 Interface& operator =(Interface const& y)
107 {
108 return *this = std::move(Interface(y));
109 }
110
111 const CClass &GetClass() const
112 {
113 return *pInterfaceClass;
114 }
115 int GetVtblOffset() const
116 {
117 return vtblOffset;
118 }
119 void SetVtblOffset( int vtblOffset ) const
120 {
121 this->vtblOffset = vtblOffset;
122 }
123
124 const Types &GetActualTypeParameters() const
125 {
126 return actualTypeParameters;
127 }
128
129 bool Equals( const Interface *pInterface ) const;
130
131 std::string GetFullNameWithActualGenericTypeParameters() const;
132
133 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
134};
135typedef std::vector<Interface *> Interfaces;
Note: See TracBrowser for help on using the repository browser.