[322] | 1 | #pragma once
|
---|
| 2 |
|
---|
[422] | 3 | class 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シリアライズ用
|
---|
| 17 | private:
|
---|
| 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 );
|
---|
[640] | 35 | ar & BOOST_SERIALIZATION_NVP( paramStr );
|
---|
| 36 | ar & BOOST_SERIALIZATION_NVP( returnTypeName );
|
---|
| 37 | ar & BOOST_SERIALIZATION_NVP( sourceIndex );
|
---|
[422] | 38 | ar & BOOST_SERIALIZATION_NVP( dynamicParams );
|
---|
| 39 | }
|
---|
| 40 |
|
---|
[322] | 41 | public:
|
---|
[637] | 42 | Delegate( const Symbol &symbol, const NamespaceScopesCollection &importedNamespaces, Procedure::Kind procKind, const char *paramStr, const std::string &returnTypeName, int sourceIndex )
|
---|
| 43 | : Procedure( symbol, procKind, false )
|
---|
[449] | 44 | , importedNamespaces( importedNamespaces )
|
---|
[422] | 45 | , paramStr( paramStr )
|
---|
| 46 | , returnTypeName( returnTypeName )
|
---|
| 47 | , sourceIndex( sourceIndex )
|
---|
| 48 | {
|
---|
| 49 | }
|
---|
[322] | 50 | Delegate()
|
---|
| 51 | {
|
---|
| 52 | }
|
---|
| 53 |
|
---|
[581] | 54 | const NamespaceScopesCollection &GetImportedNamespaces() const
|
---|
| 55 | {
|
---|
| 56 | return importedNamespaces;
|
---|
| 57 | }
|
---|
| 58 |
|
---|
[525] | 59 | const std::string &GetParamStr() const
|
---|
| 60 | {
|
---|
| 61 | return paramStr;
|
---|
| 62 | }
|
---|
| 63 | const std::string &GetReturnTypeName() const
|
---|
| 64 | {
|
---|
| 65 | return returnTypeName;
|
---|
| 66 | }
|
---|
[581] | 67 | void SetReturnType( const Type &returnType )
|
---|
| 68 | {
|
---|
| 69 | this->returnType = returnType;
|
---|
| 70 | }
|
---|
[525] | 71 |
|
---|
[588] | 72 | int GetSourceIndex() const
|
---|
[581] | 73 | {
|
---|
[588] | 74 | return sourceIndex;
|
---|
[581] | 75 | }
|
---|
[422] | 76 |
|
---|
[322] | 77 | virtual const std::string &GetKeyName() const
|
---|
| 78 | {
|
---|
| 79 | return GetName();
|
---|
| 80 | }
|
---|
[339] | 81 |
|
---|
| 82 | const Parameters &GetDynamicParams() const
|
---|
| 83 | {
|
---|
| 84 | return dynamicParams;
|
---|
| 85 | }
|
---|
[581] | 86 | Parameters &GetDynamicParams()
|
---|
| 87 | {
|
---|
| 88 | return dynamicParams;
|
---|
| 89 | }
|
---|
[448] | 90 |
|
---|
| 91 | /*!
|
---|
| 92 | @brief オーバーライド用にデリゲート同士が等しいかどうかをチェックする
|
---|
| 93 | @param dgt 照らし合わせるデリゲート
|
---|
| 94 | */
|
---|
| 95 | bool IsSimilar( const Delegate &dgt ) const;
|
---|
[637] | 96 |
|
---|
[640] | 97 | virtual bool Resolve( const ObjectModule &resolver, ResolveErrors &resolveErrors );
|
---|
[322] | 98 | };
|
---|
[525] | 99 | typedef Jenga::Common::Hashmap<Delegate> Delegates;
|
---|