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

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

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

File size: 2.1 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( dynamicParams );
36 }
37
38public:
39 Delegate( const Symbol &symbol, const NamespaceScopesCollection &importedNamespaces, Procedure::Kind procKind, const char *paramStr, const std::string &returnTypeName, int sourceIndex )
40 : Procedure( symbol, procKind, false )
41 , importedNamespaces( importedNamespaces )
42 , paramStr( paramStr )
43 , returnTypeName( returnTypeName )
44 , sourceIndex( sourceIndex )
45 {
46 }
47 Delegate()
48 {
49 }
50
51 const NamespaceScopesCollection &GetImportedNamespaces() const
52 {
53 return importedNamespaces;
54 }
55
56 const std::string &GetParamStr() const
57 {
58 return paramStr;
59 }
60 const std::string &GetReturnTypeName() const
61 {
62 return returnTypeName;
63 }
64 void SetReturnType( const Type &returnType )
65 {
66 this->returnType = returnType;
67 }
68
69 int GetSourceIndex() const
70 {
71 return sourceIndex;
72 }
73
74 virtual const std::string &GetKeyName() const
75 {
76 return GetName();
77 }
78
79 const Parameters &GetDynamicParams() const
80 {
81 return dynamicParams;
82 }
83 Parameters &GetDynamicParams()
84 {
85 return dynamicParams;
86 }
87
88 /*!
89 @brief オーバーライド用にデリゲート同士が等しいかどうかをチェックする
90 @param dgt 照らし合わせるデリゲート
91 */
92 bool IsSimilar( const Delegate &dgt ) const;
93
94 virtual bool Resolve( const ObjectModule &resolver );
95};
96typedef Jenga::Common::Hashmap<Delegate> Delegates;
Note: See TracBrowser for help on using the repository browser.