source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/include/Delegate.h@ 563

Last change on this file since 563 was 525, checked in by dai_9181, 17 years ago

デリゲート収集コードの実装をLexicalAnalyzerクラスに移動した。

File size: 1.7 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 std::string &GetParamStr() const
42 {
43 return paramStr;
44 }
45 const std::string &GetReturnTypeName() const
46 {
47 return returnTypeName;
48 }
49
50 void RefleshParameterAndReturnType();
51
52 virtual const std::string &GetKeyName() const
53 {
54 return GetName();
55 }
56
57 const Parameters &GetDynamicParams() const
58 {
59 return dynamicParams;
60 }
61
62 /*!
63 @brief オーバーライド用にデリゲート同士が等しいかどうかをチェックする
64 @param dgt 照らし合わせるデリゲート
65 */
66 bool IsSimilar( const Delegate &dgt ) const;
67};
68typedef Jenga::Common::Hashmap<Delegate> Delegates;
Note: See TracBrowser for help on using the repository browser.