/
FunctionType.h
33 lines (27 loc) · 1.16 KB
/
FunctionType.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include <memory>
#include <ostream>
#include "Assignment.h"
class Context;
class Expression;
class Value;
class FunctionType
{
public:
FunctionType(std::shared_ptr<const Context> context, std::shared_ptr<Expression> expr, std::shared_ptr<AssignmentList> parameters)
: context(std::move(context)), expr(std::move(expr)), parameters(std::move(parameters)) { }
Value operator==(const FunctionType& other) const;
Value operator!=(const FunctionType& other) const;
Value operator<(const FunctionType& other) const;
Value operator>(const FunctionType& other) const;
Value operator<=(const FunctionType& other) const;
Value operator>=(const FunctionType& other) const;
[[nodiscard]] const std::shared_ptr<const Context>& getContext() const { return context; }
[[nodiscard]] const std::shared_ptr<Expression>& getExpr() const { return expr; }
[[nodiscard]] const std::shared_ptr<AssignmentList>& getParameters() const { return parameters; }
private:
std::shared_ptr<const Context> context;
std::shared_ptr<Expression> expr;
std::shared_ptr<AssignmentList> parameters;
};
std::ostream& operator<<(std::ostream& stream, const FunctionType& f);