aboutsummaryrefslogtreecommitdiffstats
path: root/Types.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-12 23:49:26 +0800
committerChristian <c@ethdev.com>2014-12-15 20:05:18 +0800
commit2f64c56ef3a49f7551a708f63c4ed836efce7b73 (patch)
tree6dd2a10b9ef7b0a67206991416dd0a74639f66ea /Types.h
parentc8586996059c3d2ae3c7025c2d4247073468ed73 (diff)
downloaddexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.gz
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.bz2
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.lz
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.xz
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.zst
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.zip
Create contracts.
Diffstat (limited to 'Types.h')
-rw-r--r--Types.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/Types.h b/Types.h
index 807e60c7..48539a1d 100644
--- a/Types.h
+++ b/Types.h
@@ -39,6 +39,7 @@ namespace solidity
// @todo realMxN, dynamic strings, text, arrays
class Type; // forward
+class FunctionType; // forward
using TypePointer = std::shared_ptr<Type const>;
using TypePointers = std::vector<TypePointer>;
@@ -249,10 +250,16 @@ public:
virtual MemberList const& getMembers() const override;
+ /// Returns the function type of the constructor. Note that the location part of the function type
+ /// is not used, as this type cannot be the type of a variable or expression.
+ std::shared_ptr<FunctionType const> const& getConstructorType() const;
+
unsigned getFunctionIndex(std::string const& _functionName) const;
private:
ContractDefinition const& m_contract;
+ /// Type of the constructor, @see getConstructorType. Lazily initialized.
+ mutable std::shared_ptr<FunctionType const> m_constructorType;
/// List of member types, will be lazy-initialized because of recursive references.
mutable std::unique_ptr<MemberList> m_members;
};
@@ -339,8 +346,8 @@ public:
virtual std::string toString() const override;
virtual bool canLiveOutsideStorage() const override { return false; }
- TypePointer getKeyType() const { return m_keyType; }
- TypePointer getValueType() const { return m_valueType; }
+ TypePointer const& getKeyType() const { return m_keyType; }
+ TypePointer const& getValueType() const { return m_valueType; }
private:
TypePointer m_keyType;