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