retdec
dotnet_method.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_FILEFORMAT_TYPES_DOTNET_TYPES_DOTNET_METHOD_H
8 #define RETDEC_FILEFORMAT_TYPES_DOTNET_TYPES_DOTNET_METHOD_H
9 
10 #include <memory>
11 
15 
16 namespace retdec {
17 namespace fileformat {
18 
22 class DotnetMethod : public DotnetType
23 {
24  private:
26  std::unique_ptr<DotnetDataTypeBase> returnType;
27  std::vector<std::unique_ptr<DotnetParameter>> parameters;
28  std::vector<std::string> genericParameters;
34  std::size_t declaredParamsCount;
35  public:
38  const MethodDef* getRawRecord() const;
39  std::string getNameWithGenericParameters() const;
40  const DotnetDataTypeBase* getReturnType() const;
41  const std::vector<std::unique_ptr<DotnetParameter>>& getParameters() const;
42  const std::vector<std::string>& getGenericParameters() const;
43  std::size_t getDeclaredParametersCount() const;
45 
48  void setRawRecord(const MethodDef* record);
49  void setReturnType(std::unique_ptr<DotnetDataTypeBase>&& methodReturnType);
50  void setIsStatic(bool set);
51  void setIsVirtual(bool set);
52  void setIsAbstract(bool set);
53  void setIsFinal(bool set);
54  void setIsConstructor(bool set);
55  void setDeclaredParametersCount(std::size_t paramsCount);
57 
60  bool isStatic() const;
61  bool isVirtual() const;
62  bool isAbstract() const;
63  bool isFinal() const;
64  bool isConstructor() const;
66 
69  void addParameter(std::unique_ptr<DotnetParameter>&& param);
70  void addGenericParameter(std::string&& genericParam);
72 };
73 
74 } // namespace fileformat
75 } // namespace retdec
76 
77 #endif
Definition: dotnet_data_types.h:66
Definition: dotnet_method.h:23
void setIsFinal(bool set)
Definition: dotnet_method.cpp:120
const MethodDef * getRawRecord() const
Definition: dotnet_method.cpp:17
void setReturnType(std::unique_ptr< DotnetDataTypeBase > &&methodReturnType)
Definition: dotnet_method.cpp:84
bool isVirtual() const
Definition: dotnet_method.cpp:156
bool methodIsConstructor
Definition: dotnet_method.h:33
std::vector< std::string > genericParameters
Definition: dotnet_method.h:28
bool methodIsAbstract
Definition: dotnet_method.h:31
std::unique_ptr< DotnetDataTypeBase > returnType
Definition: dotnet_method.h:26
void setDeclaredParametersCount(std::size_t paramsCount)
Definition: dotnet_method.cpp:138
std::string getNameWithGenericParameters() const
Definition: dotnet_method.cpp:26
void setIsStatic(bool set)
Definition: dotnet_method.cpp:93
const MethodDef * rawRecord
Definition: dotnet_method.h:25
const std::vector< std::string > & getGenericParameters() const
Definition: dotnet_method.cpp:57
void addGenericParameter(std::string &&genericParam)
Definition: dotnet_method.cpp:201
void setIsConstructor(bool set)
Definition: dotnet_method.cpp:129
bool isStatic() const
Definition: dotnet_method.cpp:147
bool isConstructor() const
Definition: dotnet_method.cpp:183
void setRawRecord(const MethodDef *record)
Definition: dotnet_method.cpp:75
std::vector< std::unique_ptr< DotnetParameter > > parameters
Definition: dotnet_method.h:27
bool methodIsStatic
Definition: dotnet_method.h:29
void setIsVirtual(bool set)
Definition: dotnet_method.cpp:102
void addParameter(std::unique_ptr< DotnetParameter > &&param)
Definition: dotnet_method.cpp:192
void setIsAbstract(bool set)
Definition: dotnet_method.cpp:111
bool isAbstract() const
Definition: dotnet_method.cpp:165
std::size_t declaredParamsCount
Definition: dotnet_method.h:34
const DotnetDataTypeBase * getReturnType() const
Definition: dotnet_method.cpp:39
const std::vector< std::unique_ptr< DotnetParameter > > & getParameters() const
Definition: dotnet_method.cpp:48
bool methodIsVirtual
Definition: dotnet_method.h:30
bool methodIsFinal
Definition: dotnet_method.h:32
std::size_t getDeclaredParametersCount() const
Definition: dotnet_method.cpp:66
bool isFinal() const
Definition: dotnet_method.cpp:174
Definition: dotnet_type.h:30
Classes for .NET data types.
Class for .NET method parameter.
Class for .NET type.
Definition: archive_wrapper.h:19
Definition: metadata_tables.h:712