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

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

ヘッダファイルを整理中

File size: 1.7 KB
Line 
1#pragma once
2
3class Delegates;
4
5class Delegate
6 : public Procedure
7 , public Jenga::Common::ObjectInHashmap<Delegate>
8{
9 friend Delegates;
10
11 // importされている名前空間
12 NamespaceScopesCollection importedNamespaces;
13
14 std::string paramStr;
15 std::string returnTypeName;
16 int sourceIndex;
17
18 Parameters dynamicParams;
19
20 // XMLシリアライズ用
21private:
22 friend class boost::serialization::access;
23 template<class Archive> void serialize(Archive& ar, const unsigned int version)
24 {
25 trace_for_serialize( "serializing - Delegate" );
26
27 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
28 ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
29 ar & BOOST_SERIALIZATION_NVP( dynamicParams );
30 }
31
32public:
33 Delegate( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name, Procedure::Kind procKind, const char *paramStr, const std::string &returnTypeName, int sourceIndex )
34 : Procedure( namespaceScopes, name, procKind, false )
35 , importedNamespaces( importedNamespaces )
36 , paramStr( paramStr )
37 , returnTypeName( returnTypeName )
38 , sourceIndex( sourceIndex )
39 {
40 }
41 Delegate()
42 {
43 }
44
45 void RefleshParameterAndReturnType();
46
47 virtual const std::string &GetKeyName() const
48 {
49 return GetName();
50 }
51
52 const Parameters &GetDynamicParams() const
53 {
54 return dynamicParams;
55 }
56
57 /*!
58 @brief オーバーライド用にデリゲート同士が等しいかどうかをチェックする
59 @param dgt 照らし合わせるデリゲート
60 */
61 bool IsSimilar( const Delegate &dgt ) const;
62};
63
64class Delegates : public Jenga::Common::Hashmap<Delegate>
65{
66public:
67 void Collect( const BasicSource &source );
68 void GenerateSourceCode( std::string &destSource );
69 void RefleshParameterAndReturnType();
70};
Note: See TracBrowser for help on using the repository browser.