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