diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-29 23:39:30 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-30 00:11:13 +0800 |
commit | 005100c4867f133e86a2675be0dd9370fed3e191 (patch) | |
tree | d41b83ef3066a24b94a152b9e7866db5f35eff2a /Types.h | |
parent | 77384af827d7d941620552c4f5f740c3b7c576ef (diff) | |
download | dexon-solidity-005100c4867f133e86a2675be0dd9370fed3e191.tar.gz dexon-solidity-005100c4867f133e86a2675be0dd9370fed3e191.tar.zst dexon-solidity-005100c4867f133e86a2675be0dd9370fed3e191.zip |
Contract Interface Functions now return FunctionType
- Enchanced Function Type by declaration so that it can provide all the
required information at each place interface functions are consumed
- Changed all places where interface functions was used.
- Simplified Mix's FunctionDefinition code
Diffstat (limited to 'Types.h')
-rw-r--r-- | Types.h | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -41,6 +41,7 @@ namespace solidity class Type; // forward class FunctionType; // forward using TypePointer = std::shared_ptr<Type const>; +using FunctionTypePointer = std::shared_ptr<FunctionType const>; using TypePointers = std::vector<TypePointer>; /** @@ -371,8 +372,10 @@ public: TypePointers const& getParameterTypes() const { return m_parameterTypes; } std::vector<std::string> const& getParameterNames() const { return m_parameterNames; } + std::vector<std::string> const getParameterTypeNames() const; TypePointers const& getReturnParameterTypes() const { return m_returnParameterTypes; } std::vector<std::string> const& getReturnParameterNames() const { return m_returnParameterNames; } + std::vector<std::string> const getReturnParameterTypeNames() const; virtual bool operator==(Type const& _other) const override; virtual std::string toString() const override; @@ -383,7 +386,15 @@ public: virtual MemberList const& getMembers() const override; Location const& getLocation() const { return m_location; } - std::string getCanonicalSignature(std::string const& _name) const; + /// @returns the canonical signature of this function type given the function name + /// If @a _name is not provided (empty string) then the @c m_declaration member of the + /// function type is used + std::string getCanonicalSignature(std::string const& _name = "") const; + Declaration const* getDeclaration() const { return m_declaration; } + bool isConstant() const { return m_isConstant; } + /// @return A shared pointer of an ASTString. + /// Can contain a nullptr in which case indicates absence of documentation + ASTPointer<ASTString> getDocumentation() const; bool gasSet() const { return m_gasSet; } bool valueSet() const { return m_valueSet; } @@ -402,7 +413,9 @@ private: Location const m_location; bool const m_gasSet = false; ///< true iff the gas value to be used is on the stack bool const m_valueSet = false; ///< true iff the value to be sent is on the stack + bool m_isConstant; mutable std::unique_ptr<MemberList> m_members; + Declaration const* m_declaration = nullptr; }; /** |