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
RevLine 
[322]1#pragma once
2
[422]3class Delegate
4 : public Procedure
5 , public Jenga::Common::ObjectInHashmap<Delegate>
[322]6{
[449]7 // importされている名前空間
8 NamespaceScopesCollection importedNamespaces;
9
[422]10 std::string paramStr;
11 std::string returnTypeName;
12 int sourceIndex;
13
[339]14 Parameters dynamicParams;
15
[422]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 );
[637]24
25 if( ActiveBasic::Common::Environment::IsRemoveExternal() )
26 {
27 if( this->IsExternal() )
28 {
29 this->NeedResolve();
30 return;
31 }
32 }
33
[449]34 ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
[422]35 ar & BOOST_SERIALIZATION_NVP( dynamicParams );
36 }
37
[322]38public:
[637]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 )
[449]41 , importedNamespaces( importedNamespaces )
[422]42 , paramStr( paramStr )
43 , returnTypeName( returnTypeName )
44 , sourceIndex( sourceIndex )
45 {
46 }
[322]47 Delegate()
48 {
49 }
50
[581]51 const NamespaceScopesCollection &GetImportedNamespaces() const
52 {
53 return importedNamespaces;
54 }
55
[525]56 const std::string &GetParamStr() const
57 {
58 return paramStr;
59 }
60 const std::string &GetReturnTypeName() const
61 {
62 return returnTypeName;
63 }
[581]64 void SetReturnType( const Type &returnType )
65 {
66 this->returnType = returnType;
67 }
[525]68
[588]69 int GetSourceIndex() const
[581]70 {
[588]71 return sourceIndex;
[581]72 }
[422]73
[322]74 virtual const std::string &GetKeyName() const
75 {
76 return GetName();
77 }
[339]78
79 const Parameters &GetDynamicParams() const
80 {
81 return dynamicParams;
82 }
[581]83 Parameters &GetDynamicParams()
84 {
85 return dynamicParams;
86 }
[448]87
88 /*!
89 @brief オーバーライド用にデリゲート同士が等しいかどうかをチェックする
90 @param dgt 照らし合わせるデリゲート
91 */
92 bool IsSimilar( const Delegate &dgt ) const;
[637]93
[639]94 virtual bool Resolve( const ObjectModule &resolver );
[322]95};
[525]96typedef Jenga::Common::Hashmap<Delegate> Delegates;
Note: See TracBrowser for help on using the repository browser.