source: dev/trunk/ab5.0/abdev/ab_common/include/Lexical/Delegate.h

Last change on this file 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: 2.3 KB
Line 
1#pragma once
2
3class Delegate
4 : public Procedure
5 , public Jenga::Common::ObjectInHashmap<Delegate>
6{
7 // importされている名前空間
8 NamespaceScopesCollection importedNamespaces;
9
10 std::string paramStr;
11 std::string returnTypeName;
12 int sourceIndex;
13
14 Parameters dynamicParams;
15
16 // XMLシリアライズ用
17private:
18 friend class boost::serialization::access;
19 template<class Archive> void serialize(Archive& ar, const unsigned int version)
20 {
21 trace_for_serialize( "serializing - Delegate" );
22
23 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
24
25 if( ActiveBasic::Common::Environment::IsRemoveExternal() )
26 {
27 if( this->IsExternal() )
28 {
29 this->NeedResolve();
30 return;
31 }
32 }
33
34 ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
35 ar & BOOST_SERIALIZATION_NVP( paramStr );
36 ar & BOOST_SERIALIZATION_NVP( returnTypeName );
37 ar & BOOST_SERIALIZATION_NVP( sourceIndex );
38 ar & BOOST_SERIALIZATION_NVP( dynamicParams );
39 }
40
41public:
42 Delegate( const Symbol &symbol, const NamespaceScopesCollection &importedNamespaces, Procedure::Kind procKind, const char *paramStr, const std::string &returnTypeName, int sourceIndex )
43 : Procedure( symbol, procKind, false )
44 , importedNamespaces( importedNamespaces )
45 , paramStr( paramStr )
46 , returnTypeName( returnTypeName )
47 , sourceIndex( sourceIndex )
48 {
49 }
50 Delegate()
51 {
52 }
53
54 const NamespaceScopesCollection &GetImportedNamespaces() const
55 {
56 return importedNamespaces;
57 }
58
59 const std::string &GetParamStr() const
60 {
61 return paramStr;
62 }
63 const std::string &GetReturnTypeName() const
64 {
65 return returnTypeName;
66 }
67 void SetReturnType( const Type &returnType )
68 {
69 this->returnType = returnType;
70 }
71
72 int GetSourceIndex() const
73 {
74 return sourceIndex;
75 }
76
77 virtual const std::string &GetKeyName() const
78 {
79 return GetName();
80 }
81
82 const Parameters &GetDynamicParams() const
83 {
84 return dynamicParams;
85 }
86 Parameters &GetDynamicParams()
87 {
88 return dynamicParams;
89 }
90
91 /*!
92 @brief オーバーライド用にデリゲート同士が等しいかどうかをチェックする
93 @param dgt 照らし合わせるデリゲート
94 */
95 bool IsSimilar( const Delegate &dgt ) const;
96
97 virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
98
99private:
100 Delegate(Delegate const&);
101 Delegate& operator =(Delegate const&);
102};
103typedef Jenga::Common::Hashmap<Delegate> Delegates;
Note: See TracBrowser for help on using the repository browser.