CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
method_info.h
1
2#pragma once
3
4#include <system/object.h>
5#include <system/string.h>
6#include <system/array.h>
7#include <system/shared_ptr.h>
8#include <system/reflection/member_info.h>
9#include <system/reflection/binding_flags.h>
10
11namespace System { namespace Reflection {
12
13class ParameterInfo;
14
16class ASPOSECPP_SHARED_CLASS MethodInfo : public MemberInfo
17{
18 typedef MethodInfo ThisType;
19 typedef MemberInfo BaseType;
20 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
21 RTTI_INFO_DECL();
22
23public:
26 ASPOSECPP_SHARED_API MethodInfo(const String& name);
27
29 ASPOSECPP_SHARED_API virtual MemberTypes get_MemberType() const override;
30
33 ASPOSECPP_SHARED_API ArrayPtr<SharedPtr<ParameterInfo>> GetParameters() const;
34
37 ASPOSECPP_SHARED_API TypeInfo get_ReturnType() const;
38
41 ASPOSECPP_SHARED_API void AddParameter(const SharedPtr<ParameterInfo>& param);
42
45 ASPOSECPP_SHARED_API void SetReturnType(const TypeInfo& type);
46
49 ASPOSECPP_SHARED_API void SetMemberType(MemberTypes type);
50
51private:
55 TypeInfo m_return_type;
57 mutable MemberTypes m_member_type = MemberTypes::Method;
58};
59
60}} // namespace System namespace Reflection
Provides reflection information on members. Objects of this class should only be allocated using Syst...
Definition: member_info.h:16
Represents information on class method.
Definition: method_info.h:17
void SetReturnType(const TypeInfo &type)
Sets the return type of the method.
void SetMemberType(MemberTypes type)
Sets the member type (overrides abstract).
MethodInfo(const String &name)
Initializes a new instance of the MethodInfo class.
ArrayPtr< SharedPtr< ParameterInfo > > GetParameters() const
Returns the parameters of the method.
void AddParameter(const SharedPtr< ParameterInfo > &param)
Adds a parameter to the method.
TypeInfo get_ReturnType() const
Gets the return type of the method.
virtual MemberTypes get_MemberType() const override
Gets a MemberTypes value indicating that this member is a method.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:126
Represents a particular type and provides information about it.
Definition: type_info.h:109
MemberTypes
Marks each type of member.
Definition: member_types.h:11
@ Method
Specifies that the member is a method.
Definition: db_command.h:9