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

Last change on this file since 634 was 603, checked in by dai_9181, 17 years ago

ObjectModuleに関連するクラス一式をab_commonプロジェクトに移動した。

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